Skip to content
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

Closed
ghost opened this issue Oct 14, 2011 · 7 comments
Closed

Add Last-Modified header to response #16

ghost opened this issue Oct 14, 2011 · 7 comments

Comments

@ghost
Copy link

ghost commented Oct 14, 2011

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).

@lsmith77
Copy link
Contributor

good point .. think we need to explore if to delegate responsibility for this to the data loader.
at the same time .. in my current application we are handling this via our custom Controller.

@lsmith77
Copy link
Contributor

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.

@ghost
Copy link
Author

ghost commented Oct 15, 2011

actually thinking about this some more .. when using file system caching it should be handled by the web server.

Yes, but for the first request which hits the app we don't serve this header (we should).

when disabling caching i think the normal use case will be using a reverse proxy which again will automatically handle this.

I am not sure. Why the reverse proxy will handle it differently if original response doesn't contain this header?

@ghost
Copy link
Author

ghost commented Oct 15, 2011

Please reconsider this PR.

@lsmith77
Copy link
Contributor

@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 ..

@LouTerrailloune
Copy link
Contributor

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 think a redirection if more than doanloading the content twice.

@lsmith77
Copy link
Contributor

i have refactored the entire response creation quite a bit. so it should enable people to do whatever they need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants