I have been reading about the new Service Workers support for Angular 5 and 
Angular CLI and I found it fascinating. I'm particularly interested in 
caching API end points. In all the tutorials I have read, they all seem to 
focus on caching end point calls once and then serving future requests from 
the cache storage. What if my web application frequently updates or inserts 
data? All my requests would still continue being served from the cache 
which will result in fetching old data and not the new data that I just 
updated or inserted which would only be retrieved if I make a new call to 
the API end point. How can we keep this in sync?

To make my question a bit clear; In short what I am asking for is how can 
you refresh your cache based on your need.I understand that If I pick 
'freshness' strategy, it will always fetch from network except at the time 
of network failure or time out in which case it defaults to the cache. If I 
pick 'performance' strategy, it will always serve from cache and will not 
be suitable for things that change often. What I'm looking for is a little 
bit of both. I would like it to always serve from the cache except in the 
case where I specifically tell it not to. For example when I create new 
customer, I would like to refresh the cache and then it continues to serve 
from the cache until I tell it to refresh otherwise.

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/6b0d243d-0404-474f-b509-08e69f5cd104%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to