-
Notifications
You must be signed in to change notification settings - Fork 380
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
Add Last-Modified header to response #16
Comments
good point .. think we need to explore if to delegate responsibility for this to the data loader. |
actually thinking about this some more .. when using file system caching it should be handled by the web server. when disabling caching i think the normal use case will be using a reverse proxy which again will automatically handle this. so imho we should not handle this either. as for cache headers this should be also be handled by the user .. either with a custom controller or via LiipCacheControlBundle. |
Yes, but for the first request which hits the app we don't serve this header (we should).
I am not sure. Why the reverse proxy will handle it differently if original response doesn't contain this header? |
Please reconsider this PR. |
@MHeleniak: my point is more i guess .. its close to impossible to really properly handle this generically. cache validation is simply too application specific. the right solution is for users to extend the Controller and/or use LiipCacheControlBundle to set cache headers. now one thing that we could think about is how the data loader could return such metadata back to the Controller .. |
Adding an option (or using a custom cache path resolver) to redirect after creation of the image cache would resolve this. First time we just generate image and redirect 301, next time the webserver returns the file directly. |
i have refactored the entire response creation quite a bit. so it should enable people to do whatever they need. |
For better front end performance on first request, response should be sent with Last-Modified header.
When implementing please add a check for 304 responses (
Response#isNotModified
).The text was updated successfully, but these errors were encountered: