expressjs / serve-static

Serve static files
MIT License
1.38k stars 227 forks source link

Make 'immutable' cache-control value HTTP/3 QPACK compatible #149

Open naz opened 1 year ago

naz commented 1 year ago

At the moment passing an immutable: true option adds an immutable value to the Cache-Control header. Ideally the header would be put as a separate Cache-Control header entry making such request QPACK-compatible.

Note: When evaluating the use of immutable and QPACK: If you're concerned that immutable changes the predefined value provided by QPACK, consider that in this case, the immutable part can be encoded separately by splitting the Cache-Control value into two lines — though this is dependent on the encoding algorithm a particular QPACK implementation uses. (MDN reference)

dougwilson commented 1 year ago

I like it 👍 . Not sure if there are any implications to cache software in handing multiple header or not, but I don't think it would matter since cache-control is optimistic anyway if an intermediary just looked at the first cache-control header only.