Comments (4)
In case someone has the same issue I had here what I've done :
So far I was using Heroku, I struggled a bit to handle this cache-control I figured out you can add a no cache param to serve
(check there). I was not really satisfied. So I look for others possibilities, I came across Firebase where you can actually very easily doing this headers configuration through a firebase.json
file, it works like a charm now.
from preact-starter.
Hey Alex, thanks!
This is because your Heroku server is caching the service-worker.js
file, which is the main gotcha for Service Workers.
You have to turn off caching for the SW file specifically, as this is the only way that the SW can discern if there's a newer version of itself.
If cached, the following /service-worker.js
requests, will all return the same content with the same versioning info (and the same assets cache definition), which tells the registered SW that there is not anything new to worry about, so nothing changes.
Hope that helps!
from preact-starter.
Thank you very much for your help on it, @lukeed !
From my understanding I need to specify something like cache-control:private, max-age=0, no-cache in my sw header.
from preact-starter.
Yeah, I forget you can't specify headers with serve
-- maybe I'll look into PR'ing that. Most static-servers will let you configure headers, like Firebase hosting.
Thanks for following up~!
from preact-starter.
Related Issues (13)
- TypeError: history.listen is not a function HOT 2
- [Suggestion] - add svg sprite loader HOT 3
- Why is style and javascript seperated HOT 5
- props and states HOT 2
- Sass -> Scss HOT 1
- GPG signature for this Yarn release is invalid? HOT 3
- adding google maps preact way HOT 1
- Preact Starter & Firebase HOT 1
- npm install fails; obsolete packages, missing python2
- fix: webpack config is using undefined variable. HOT 1
- Readme links to a private repo HOT 1
- News about SSR? HOT 3
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 preact-starter.