Comments (5)
Yes, this is indeed an issue with workbox, as investigated by @jeffposnick in GoogleChrome/workbox#691. I now commented out the code in question, which should fix it for now. Let me know if you're still seeing the behaviour after two reloads.
from samples.
I'm not sure what you commented out, but if you try switching from CacheFirst
to StaleWhileRevalidate
for that feed until we've fixed the underlying bug, you'll end up with reasonable behavior.
from samples.
@jeffposnick sadly I don't think so, as that would mean that a person coming back to the app a few days later will see old stuff, no? Or does staleWhileRevalidate honor the cacheExpiration?
from samples.
So even when GoogleChrome/workbox#694 is merged they'll see old stuff on the next visit when using CacheFirst
, because we don't have a Date
header on the cross-origin response and therefore can't tell synchronously whether the response is fresh or not. The change in that PR will mean that the content will at least get purged in the background for the next visit.
StaleWhileRevalidate
along with broadcastCacheUpdate
configured to announce changes to the previously cached resource is probably the ideal configuration for this use case—you can listen for that update and then swap in the new content from the context of the page. The use of broadcastCacheUpdate
for cross-origin resources also would be a problem, though, because it relies on checking Response headers, and I don't believe the Yahoo! API you're using whitelists the headers it needs...
from samples.
I think I'll do networkFirst instead for now, to keep it fresh and only handle the offline use-case. Thanks for the pointers though, might play around with boradcastCacheUpdate!
from samples.
Related Issues (20)
- Dependency deprecation warning: babel-preset-es2015 (npm)
- Dependency deprecation warning: babel-preset-es2015 (npm)
- Error in running Amp-pwa sample HOT 5
- Unable to install amp-paywall-demo
- Remove Google+ from AMP Samples
- amp-camp fails to start
- Creating a PWAMP application using wordpress as CMS HOT 6
- Consider some accessibility for the top of the page at https://amp-article.herokuapp.com/ HOT 1
- AMP Camp: related products don't work when you click on item from cart
- In amp-update-cache sample we are getting amp_ts=undefined error.
- I tried to find the declaration the ${ampjs} but I did not find it. ¿Where is it? HOT 1
- Rename the default branch of this repo from `master` to `main` HOT 7
- Sample for angular
- Demo is down
- Dependency Dashboard
- ampproject/samples
- Samples
- Working Groups for amp
- Ampproject/examples HOT 1
- Sex video HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samples.