0
votes

I have a Symfony2 app using assetic. Everything is fine except that in localhost my assetic assets does not get cached by browser.

Any idea why the following assets does not get served cached with response 304 and in milliseconds but instead with 200 response and takes about 15 seconds....

Response Headers

Accept-Ranges bytes
Cache-Control max-age=604800
Connection Keep-Alive
Content-Encoding gzip
Content-Type application/javascript
Date Fri, 20 Mar 2015 13:26:55 GMT
Etag "159d57-511b83723ef71-gzip"
Expires Fri, 27 Mar 2015 13:26:55 GMT
Keep-Alive timeout=5, max=100
Last-Modified Fri, 20 Mar 2015 13:23:00 GMT
Server Apache/2.4.9 (Win64) PHP/5.5.12
Transfer-Encoding chunked
Vary Accept-Encoding

Request Headers

Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cache-Control max-age=0
Connection keep-alive
Cookie XDEBUG_SESSION=16069
Host localhost
If-Modified-Since Fri, 20 Mar 2015 13:23:00 GMT
If-None-Match "159d57-511b83723ef71-gzip"
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:36.0) Gecko/20100101 Firefox/36.0


Even if I go directly to this file through browser and then press F5 cache is not working.... But instead in other files i get 304 instead of 200...

1
Do you have assetic_use_controller set to true in your configuration for assetic? That would force symfony to serve the request instead of the filesystem.phpisuber01
i use assetic_use_controller: falseNick Doulgeridis

1 Answers

0
votes

I am sorry for trouble, problem was the Apache deflate bug when using ETAGs. By disabling ETAGs its working fine and returns 304.