Comments (5)
How often would we expect such read failures to actually happen?
/cc @pmeenan
from compression-dictionary-transport.
It shouldn't be meaningfully different from a 304 not-modified and should probably be treated the same way. In both cases, the browser has an index where it believes the cache entry is available, makes the request and depends on the entry actually being there.
Not sure if the fetch specs actually specify the behavior in that case of if it is implementation-specific but the breakage (and overhead for checking the entry) should be the same.
from compression-dictionary-transport.
I was thinking about using two databases, SQLite for keeping the metadata (path, hash, etc), DiskCache for keeping the blob (binary) of the dictionary. (PoC CL: https://chromium-review.googlesource.com/c/chromium/src/+/3872966/37)
But unfortunately, DiskCache doesnโt provide a way to detect the cache entry eviction. So Chrome has to open the DiskCache entry before sending the request with the sec-bikeshed-available-dictionary:
header. This is not good for performance.
It sounds like using DiskCache as a blob storage is not a good idea. It is impossible to keep the two databases in sync in an efficient way. I will reconsider the design to use raw files.
Re: @pmeenan
Chrome opens the disk cache entry before sending the network request, and keeps the entry as active so that the entry would not be evicted. So 304 not-modified responses can be handled correctly even if the eviction logic has been triggered.
https://source.chromium.org/chromium/chromium/src/+/main:net/http/http_cache_transaction.cc;l=734;drc=e672a665ffa8fe4901184f03922e2cc548399da5
I think we should not block the browser from sending the request while opening the dictionary file.
from compression-dictionary-transport.
Would it help if we added a requirement that dictionaries must be immutable? We could then maybe tweak the eviction logic to make sure they don't get evicted while there's a request that relies on them in flight
from compression-dictionary-transport.
Adding such a requirement sounds good to me.
By the way, @nhiroki told me that using APP_CACHE CacheType can prevent the auto eviction. So I think I can use DiskCache as a storage for the shared dictionary, just like Service Worker scripts and CacheStorage.
from compression-dictionary-transport.
Related Issues (20)
- No support for hash-based versioning HOT 2
- sec-fetch-dest for dictionary fetch HOT 8
- Allow for hash/versions in the middle of the path HOT 2
- Add cross-origin compression protection
- Copy edit issue HOT 1
- Consider making sec-available-dictionary: value path-safe
- Standards positions HOT 3
- i.e. vs e.g.
- Path parsing HOT 3
- Abbreviated structured field dictionary keys HOT 5
- Grabbing authority for paths closer to the root HOT 3
- Consider Websocket use case HOT 9
- Consider support other Content-Encoding schemes HOT 2
- Clear Site Data for dictionaries HOT 11
- Exposing storage usage for dictionaries HOT 11
- Dictionary partitioning in browsers without tripled-keyed HTTP cache HOT 1
- Define mechanism for advertising non-bytestream dictionary formats
- Content-encoding may be fragile
- Consider options for Path of side-loaded dictionaries HOT 1
- Hashes, algorithm agility, and overlap with HTTP digests. HOT 7
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 compression-dictionary-transport.