-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for fetching cached data #23
Comments
I have not ran into that use case myself (yet). Would be open for a PR if
you can think of a good api to support it. Might also be better handled
using a service worker (if your browser support doesn't include IE).
…On Tue, Oct 2, 2018, 4:06 PM Nathan Klug ***@***.***> wrote:
Hi! Thanks so much for your work on this package; overall I really like
the API!
I was wondering if there's any way to allow for fetching data on
mount/update even when that data has been cached? I know that seems to go
against the purpose of a cache, but I'd like to optimistically show data
that's already been loaded and doesn't change often (and possibly been
cached for a longer period of time, like in localStorage/sessionStorage)
but still fetch in case any changes have happened. This is for an
enterprise application which receives fairly low traffic, so I don't need
caching for load reasons.
From my reading of the fetch method, it looks like this isn't something I
could do with a custom Cache =/
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#23>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAK1RNv9alo4o3_PVVrwSZffpQnGgkJqks5ug8c2gaJpZM4XExg4>
.
|
Maybe adding support for a `strategy` prop similar to workbox, with your
use case covered by `staleWhileRevalidate`. Just a thought. I foresee me
getting anytime soon to add this, but would be able to provide feedback on
a PR.
https://developers.google.com/web/tools/workbox/
…On Tue, Oct 2, 2018, 7:13 PM Sean Lynch ***@***.***> wrote:
I have not ran into that use case myself (yet). Would be open for a PR if
you can think of a good api to support it. Might also be better handled
using a service worker (if your browser support doesn't include IE).
On Tue, Oct 2, 2018, 4:06 PM Nathan Klug ***@***.***> wrote:
> Hi! Thanks so much for your work on this package; overall I really like
> the API!
>
> I was wondering if there's any way to allow for fetching data on
> mount/update even when that data has been cached? I know that seems to go
> against the purpose of a cache, but I'd like to optimistically show data
> that's already been loaded and doesn't change often (and possibly been
> cached for a longer period of time, like in localStorage/sessionStorage)
> but still fetch in case any changes have happened. This is for an
> enterprise application which receives fairly low traffic, so I don't need
> caching for load reasons.
>
> From my reading of the fetch method, it looks like this isn't something
> I could do with a custom Cache =/
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#23>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AAK1RNv9alo4o3_PVVrwSZffpQnGgkJqks5ug8c2gaJpZM4XExg4>
> .
>
|
Unfortunately I need to support IE11, otherwise I would love to use SWs =/
I don't think I'll be able to get to this for a little while, but who knows :) |
Hi! Thanks so much for your work on this package; overall I really like the API!
I was wondering if there's any way to allow for fetching data on mount/update even when that data has been cached? I know that seems to go against the purpose of a cache, but I'd like to optimistically show data that's already been loaded and doesn't change often (and possibly been cached for a longer period of time, like in localStorage/sessionStorage) but still fetch in case any changes have happened. This is for an enterprise application which receives fairly low traffic, so I don't need caching for load reasons.
From my reading of the
fetch
method, it looks like this isn't something I could do with a custom Cache =/The text was updated successfully, but these errors were encountered: