-
Notifications
You must be signed in to change notification settings - Fork 94
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
Ability to set cache-control headers and compression #195
Comments
@tanc thanks for the detailed request ! I think it's a great suggestion, we'll add this to the roadmap. |
This is implemented in |
# [1.0.0-beta.17](v1.0.0-beta.16...v1.0.0-beta.17) (2021-03-10) ### Bug Fixes * error when unhandled socket event ([3e0151a](3e0151a)) * req.query not typed ([581e3ca](581e3ca)) * socket io protocol error ([6e414a0](6e414a0)) * **add branch:** should not update release when no id given ([b3b25e8](b3b25e8)) ### Features * add websocket handler [#194](#194) ([2aad514](2aad514)) * change api scope formats ([#200](#200)) ([ed34896](ed34896)) * configure gzip compression ([#195](#195)) ([bc5e3ff](bc5e3ff)) * custom headers per branch or site ([#195](#195)) ([c8645a7](c8645a7)) * forbid underscores in site name ([#193](#193)) ([f263f09](f263f09)) * set cache-control header ([#195](#195)) ([09621ea](09621ea)) ### BREAKING CHANGES * all API tokens currently in use will be invalidated.
Wow amazing! Will test this out soon |
This was released on beta. I'm closing, but feel free to comment and we'll reopen if needed. |
At the moment it seems like there is no cache-control header set and the resources are served with no compression (gzip, brotli).
It would be great if Meli had some sane defaults, much like Netlify does, which would make serving static files even more efficient. Then ideally there would be some settings to configure cache headers on a site-by-site basis within the UI (or a config file like Netlify uses).
Netlify set a cache-control header like this:
They say that it makes the browser re-check for changes each time but against the etag to see if anything has changed. Supposedly this is very efficient with HTTP2. From what I can tell without a cache-control header my browser is caching the resources served by Meli and when I update the branch with a new release I got inconsistent results. One time I reloaded the page and the css file I'd changed didn't update, then on other releases it did update. Without further testing its hard to say whether setting a cache-control would provide the consistency or hurt performance.
It would be good to see resources gzipped on-the-fly with Caddy, I believe this is the directive: https://caddyserver.com/docs/caddyfile/directives/encode
Thanks for your efforts!
The text was updated successfully, but these errors were encountered: