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

HTTP status code 200 (cache) vs status code 304? #61

Closed
kazoostudios opened this issue May 8, 2015 · 3 comments
Closed

HTTP status code 200 (cache) vs status code 304? #61

kazoostudios opened this issue May 8, 2015 · 3 comments

Comments

@kazoostudios
Copy link

Can Glide serve images that are more aggressively browser cached - status 200 (cache) instead of 304?

@kazoostudios
Copy link
Author

@reinink
Copy link
Contributor

reinink commented Jun 9, 2015

Originally Glide returned a 200 status code. Now it returns 200 for the first request, and 304 for subsequent requests. This was actually at request. See #20. I did a bunch of research into it at the time, and it seemed that returning a 304 was the correct way to do this.

I'm probably going to setup an option to define this however you want. However, in the meantime you're welcome to modify the response object manually. As per the docs, you can get the response object instead of simply outputting the image right away. Something like this:

$response = $server->getImageResponse();
// modify...
$response->send();

@reinink
Copy link
Contributor

reinink commented Jun 15, 2015

An update on this:

The next iteration of Glide will have a ResponseFactory interface, which will allow you to override the default response that is created to whatever you prefer. More details on that here.

I'm going to close this issue since we have it covered in that other issue. However, you can expect this feature in an upcoming release.

@reinink reinink closed this as completed Jun 15, 2015
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