-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
HTTP cache rework and enable caching for storage assets #13569
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
Conversation
Working on generalizing http cache handling a bit in a separate module. |
292df9f
to
0c90406
Compare
The only things that remain uncachable are the avatar redirects, we should get rid of them later. |
d726299
to
384ab84
Compare
Why do you think we should get rid of server redirect? If the assets are stored on a s3 compatible service, it's useful to reduce the bandwidth of the server. |
It seems like a useless roundtrip that hurts performance. I don't see why it couldn't just directly output the correct URLs, especially for local storage. 302/307 redirects are by definition uncachable and must be attempted every page load. We can't use cachable permanent 301/308 redirects either because that would make avatars essentially immutable. I think it'd be best drop it and emit direct links. |
This enabled HTTP time-based cache for storage assets, primarily avatars. I have not observed If-Modified-Since from browsers during tests but I guess it's good to support regardless. It introduces a new generic httpcache module that can handle both time-based and etag-based caching. Additionally, manifest.json and robots.txt are now also cachable.
🚀 |
This enabled HTTP time-based cache for storage assets, primarily avatars. I have not observed
If-Modified-Since
from browsers during tests but I guess it's good to support regardless.It introduces a new generic httpcache module that can handle both time-based and etag-based caching.
Additionally, manifest.json and robots.txt are now also cachable.