Comments (2)
Here are blogs related to caching:
Well, seems that you want to precache some files. I notice that you use Next.js, so there's a few things to keep in mind:
-
If you want to precache some pages, fonts, and images, you will have to use
additionalPrecacheEntries
. This option expects you to generaterevision
yourself, which is quite a pain, but I guess you can simply create an utility function that can hash a file's content. Hopefully we can improve this field a bit. One thing to keep in mind is that it is not recommended that you precache server-side rendered pages since they will then always be served by the precache rather than the network until the service worker is updated so that said pages should not be precached. -
@serwist/next
precaches all CSS and JavaScript files for you out of the box unless you useexclude
,excludeChunks
,include
, orincludeChunks
. -
Don't think about precaching HTML files 💀 With how Next.js does its things, you just can't get a proper list of HTML files to precache.
Also, next time, please use GitHub Discussions if you want to ask a question. Our Issues is only meant for bugs and feature requests.
from serwist.
This issue is stale because it has been open for 30 days with no activity.
from serwist.
Related Issues (20)
- [Docs]: Next.js, where are the cache expiration settings and similar configuration HOT 8
- [Bug]: Error [ERR_REQUIRE_ESM]: require() of ES Module HOT 2
- [Bug]: serwist tries to install service worker with different name than specified in next config HOT 2
- [Bug]: Problem with old safari version HOT 9
- [Bug]: Logs spammed on console in production HOT 3
- [Bug]: Browser export missing from NextJS package HOT 3
- [Bug]: When using serwist/next with pyodide/webpack-plugin - "TypeError: The 'compilation' argument must be an instance of Compilation" HOT 8
- question about globals in `@serwist/core` and `globals.d.ts` HOT 4
- [Bug]: Type error: An expression of type 'void' cannot be tested for truthiness. HOT 1
- `@serwist/next` - additionalPrecacheEntries prevents automatically precaching public dir files
- [Bug]: Vercel build fails to load next.config.js HOT 4
- Question: Is there a way to disable the precaching? HOT 4
- [Docs]: Build fails if you follow setup guide Next.js HOT 1
- [Bug]: Preload config error HOT 6
- [Docs]: Install button not showing up in browser url bar after following serwist next instructions HOT 2
- [Bug]: next.js dev server not working HOT 7
- [Bug]: next-web-push example not working
- [Bug]: Fetch requests do not go through service worker HOT 4
- [Bug]: Service Worker is installed on a page out of scope. HOT 4
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 serwist.