Runtime caches
See original GitHub issueHello, really nice plugin!
I’m doing a server side render of blog posts and was hoping to cache the server side render as externals, but your documentation says I cannot pattern match externals. What would be the recommended solution here? I’m really trying to avoid having to list each possible blog post path as an external.
new OfflinePlugin({
caches: {
main: [
'/',
':rest:',
],
additional: [
'/post/*',
],
},
externals: [ '/', '/post/*' ],
scope: '/',
updateStrategy: 'all',
version: 'v1',
ServiceWorker: {
output: 'sw.js',
},
AppCache: {
directory: 'appcache/',
},
}),```
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Caching resources during runtime - Chrome Developers
Learn how to handle caching resources during runtime, including cross-origin resources.
Read more >System.Runtime.Caching Namespace - Microsoft Learn
ObjectCache Class (System.Runtime.Caching). Represents an object cache and provides the base methods and properties for accessing the object cache.
Read more >Runtime Caches - SAP Help Portal
Cache refresh is triggered automatically when an object in the ES Repository or in the Integration Directory is activated. In addition to this,...
Read more >Cache · Cloudflare Workers docs
For instance, Cloudflare Workers runtime exposes a single global cache object. let cache = caches.default;. await cache.match(request);.
Read more >System.Runtime.Caching 7.0.0 - NuGet
System.Runtime.Caching 7.0.0 ·.NET CLI · Package Manager · PackageReference · Paket CLI · Script & Interactive · Cake.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thinking more about it, it won’t be possible to implement even runtime pattern matching for
main
andadditional
cache section since plugin simply do not know what to cache, i.e. it doesn’t what means'/post/*'
. To match pattern for assets, we have to do matching agains something, e.g. agains generated assets or URLs requested from page in runtime. Given that, pattern matching at runtime could be implemented only foroptional
cache section since it’s to cache assets only when they were requested.Here is possible API design for it: https://github.com/NekR/offline-plugin/issues/117
Can you take a look? Would you be okay with it?