-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entries movement between caches #871
Comments
Just saw this comment: #867 (comment) Yes, something like that! |
Closing as a dupe, reopen if I'm wrong |
FWIW implementations can be smart about this and detect that a Response from the same CacheStorage is being put back into. In this case the browser can avoid re-writing the body. But yea, a more/rename would be nice. Edit: And I plan to do that eventually in gecko when this is implemented: https://bugzilla.mozilla.org/show_bug.cgi?id=1110479 |
Dupe of what? Would be good to know it, so I could track that issue. Or if you meant dupe of that comment, then I referred to a comment in not-related issue.
I thought about it, but without a special function exactly for that we have to convince all implementations to have such optimization. |
Are you happy with |
@jakearchibald it's not about renaming caches (which would be good to have by itself), but about moving individual entries of cache |
I think we should look at transactions before providing more high-level cache manipulation APIs. The stuff in your OP is possible today, right? You can take something out of one cache and put it in another. |
@jakearchibald yes, possible and I do not insist that it's 'you must do it immediately'. Just left it here as 'would be good to have'. Also, it's probably not a high-level API since, just an abstraction over 'move reference of this object in DB from this cache to this cache'. Something what we cannot do today: manipulate cache references. |
I don't think the spec should mandate optimizations or perf for something like this. The API provides a way to take something from cache A and put it in cache B. Its flexible enough for implementations to optimize. I don't think we should tie implementation's hands by prematurely forcing an optimization here. |
Sounds reasonable. Anyway, would be good to have this API. |
You could write bugs like that, but it would be interesting to know if its slow in the first place. Unless you are moving extremely large files its probably not noticeable. |
I do not know how slow it's, but I can imagine slow old HDDs where each operation is slow operation. |
I have a such situation:
One primary cache, let's call it
static
. This cache always exists, never changes name and only entries in it are changed. Difference is found by comparing two maps 1) existing, described currently cached entries; 2) new, which came with a newly generate SW (new build). Difference is computed oninstall
event and new assets/files are stored intmp
cache. Then, onactivate
event, old assets are deleted fromstatic
cache or simply overridden by new version (if file name/url wan't changed).My question, can we have some fastest way to import entries from one cache to another? Because as far as I understand, reading from one cache and writing to another is kind of slow and not "looking good" operation.
The text was updated successfully, but these errors were encountered: