beakerbrowser / homebase

Self-deployable tool for hosting hyper:// websites
MIT License
407 stars 36 forks source link

Overly long Cache-Control max-age when mirroring to https #36

Closed paul90 closed 5 years ago

paul90 commented 5 years ago

When mirroring content to https the response contains a cache control with a max-age of 1 year. https://github.com/beakerbrowser/homebase/blob/7c5da47e1cb6a2ac254016768c84d1d4db3ed735/lib/vhosts/dat.js#L197

While for static content this is not a problem, for changing content if the browser has it in its cache the cached version will be used without checking with homebase to see if a more up to date version of the file is available.

As etag is set, and checked with the request, it would be better to set max-age=0, and let the match against If-None-Match in the request take effect.

pfrazee commented 5 years ago

Okay, I'd be 👍 with a PR to do that.