You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These days I am trying image processing,and tried spatie/laravel-glide base on http://glide.thephpleague.com/, and at the same time I used your httpcache pakage.
what make me crazy is no matter how to try images can't be cached by browers.
spended lots of time ,finally i found that every time I send a request to server,the below function in symfony Response:
public function isNotModified(Request $request)
{
if (!$request->isMethodSafe()) {
return false;
}
[2015-11-21 07:54:05] local.INFO: Cache-Control: max-age=31536000, public
Content-Length: 12120
Content-Type: image/jpeg
Date: Sat, 21 Nov 2015 07:54:05 GMT
Expires: Mon, 21 Nov 2016 07:54:05 GMT
Last-Modified: Sat, 21 Nov 2015 05:26:38 GMT
[2015-11-21 07:54:05] local.INFO: Cache-Control: private
Content-Type: text/html; charset=UTF-8
Date: Sat, 21 Nov 2015 07:54:05 GMT
X-Symfony-Cache: GET /img/greatwall?filt=greyscale&q=60&s=f731d23929793b5021f7a00c0ab6c855&w=300: miss
Then I removed http-cache related middleware,It worked,got 304 and isNotModified only called once,
[2015-11-21 07:56:47] local.INFO: Cache-Control: max-age=31536000, public
Content-Length: 12120
Content-Type: image/jpeg
Date: Sat, 21 Nov 2015 07:56:47 GMT
Expires: Mon, 21 Nov 2016 07:56:47 GMT
Last-Modified: Sat, 21 Nov 2015 05:26:38 GMT
httpcache cased that can't get
$lastModified = $this->headers->get('Last-Modified');
$modifiedSince = $request->headers->get('If-Modified-Since');
at same time. So every time isNotModified() executed,return false.
It seems that all request missed cache,the cache directory is empty,and it has write permission.So maybe that means this package don't work in fact,so every time missed,then fetch it and changed the original header,so images can't cached by browser too.
These days I am trying image processing,and tried spatie/laravel-glide base on http://glide.thephpleague.com/, and at the same time I used your httpcache pakage.
what make me crazy is no matter how to try images can't be cached by browers.
spended lots of time ,finally i found that every time I send a request to server,the below function in symfony Response:
public function isNotModified(Request $request)
{
if (!$request->isMethodSafe()) {
return false;
}
was called twice.
[2015-11-21 07:54:05] local.INFO: Cache-Control: max-age=31536000, public
Content-Length: 12120
Content-Type: image/jpeg
Date: Sat, 21 Nov 2015 07:54:05 GMT
Expires: Mon, 21 Nov 2016 07:54:05 GMT
Last-Modified: Sat, 21 Nov 2015 05:26:38 GMT
[2015-11-21 07:54:05] local.INFO: Cache-Control: private
Content-Type: text/html; charset=UTF-8
Date: Sat, 21 Nov 2015 07:54:05 GMT
X-Symfony-Cache: GET /img/greatwall?filt=greyscale&q=60&s=f731d23929793b5021f7a00c0ab6c855&w=300: miss
Then I removed http-cache related middleware,It worked,got 304 and isNotModified only called once,
[2015-11-21 07:56:47] local.INFO: Cache-Control: max-age=31536000, public
Content-Length: 12120
Content-Type: image/jpeg
Date: Sat, 21 Nov 2015 07:56:47 GMT
Expires: Mon, 21 Nov 2016 07:56:47 GMT
Last-Modified: Sat, 21 Nov 2015 05:26:38 GMT
httpcache cased that can't get
$lastModified = $this->headers->get('Last-Modified');
$modifiedSince = $request->headers->get('If-Modified-Since');
at same time. So every time isNotModified() executed,return false.
I haven't research why httpcache package cased the problem,you could give me some explanation ,thank you very much .
I use this link to test ,
http://www.bigfeettrip.com/img/greatwall?w=300&q=60&filt=greyscale&s=f731d23929793b5021f7a00c0ab6c855
The text was updated successfully, but these errors were encountered: