Closed publicocean0 closed 7 years ago
Yes; for instance, using this example configuration from the docs:
toolbox.router.get(/\.ytimg\.com\//, toolbox.cacheFirst, {
// Use a dedicated cache for the responses, separate from the default cache.
cache: {
name: 'youtube-thumbnails',
// Store up to 10 entries in that cache.
maxEntries: 10,
// Expire any entries that are older than 30 seconds.
maxAgeSeconds: 30
}
});
thanks it is very interesting.
I explain my problem so you can understand better , maybe there is a solution here or maybe i can suggest a new feature here.
I have a stream of contents arriving by websocket.
I want implement a cache so browser dont ask the same contents.
Initially i developped a cache using filesystem api ... it is cool but now fsapi are deprecated and anyway not implemented by all browsers. So I have a problem.
Considering the cache limit in appcache is higher than indexdb (a lot ) .... i thought to use it.
Content are arraybuffer.
so if i save content as new Response(
I don't think that's something that sw-toolbox
will help with, no. I don't want to say that it's impossible using the Cache Storage API, but there's nothing in sw-toolbox
that is relevant to that scenario.
The problem there is nothing in html and web api rilevant for that scenario. i want suicide me :)
it is possible to define a lru policy or a way last request is always cached end eventually delete the oldest? This will grant when cache works also when is full.