SylvainTI / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Minify ignores no-cache header sent form the client #316

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Minify commit/version: 2.1.7
PHP version: 5.3.27

What steps will reproduce the problem?
1. Load a url with minify css 
2. Force refresh (shift+cmd+r on mac)
3. Page returns 304 Not modified (with no content) even though client asked for 
no-cache 

Expected output:
When the clients sends header: cache-control: no-cache this should force a 200 
OK from the server with attached content

Actual output:
The problem is that if you force-refresh on chrome, it acts as if it didn't 
have the content, so it deletes the (or don't use) its cached content. If then 
Minify responds with 304 not modified, and does not send new content, then none 
of the minified content is used.

Original issue reported on code.google.com by dino.pa...@gmail.com on 13 Jun 2014 at 8:37

GoogleCodeExporter commented 9 years ago
Just a note, it actually made minify useless for me... Site was "trashed" (no 
css) everytime minify didn't get to load just once. A

Original comment by dino.pa...@gmail.com on 13 Jun 2014 at 9:13

GoogleCodeExporter commented 9 years ago
Why us Chrome sending conditional GET headers if it can't handle a 304 
response? Can you send me a detailed request/response header list?

Original comment by mrclay....@gmail.com on 13 Jun 2014 at 10:59

GoogleCodeExporter commented 9 years ago
I suspect you have a local extension that is causing Chrome not to follow the 
HTTP spec correctly)

Original comment by mrclay....@gmail.com on 13 Jun 2014 at 11:04

GoogleCodeExporter commented 9 years ago
Searching further into the issue, there might be a transparent proxy between me 
and my server, which is cause of the issue.

(With that said, shouldn't Minify handle no-cache in still?)

The test i've done now is that i added debug headers, and it seems that the 
response does not get served by, something else is responding and not handling 
no-cache and no last-modified,etag header. 

Original comment by dino.pa...@gmail.com on 13 Jun 2014 at 11:27

GoogleCodeExporter commented 9 years ago
Request
Request URL: 
http://XXXXX.com/min/?f=/css/style.css,/css/photoswipe.css,/css/magnific-popup.c
ss
Request Method:GET
Request Headersview source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.
8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en,en-US;q=0.8,da;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Cookie: XXXXX
DNT:1
Host: XXXXX.com
Pragma:no-cache
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

Response
Status Code:304 Not Modified
Cache-Control:max-age=1800
Connection:Keep-Alive
Date:Fri, 13 Jun 2014 11:28:55 GMT
ETag:"pub1402591632"
Expires:Fri, 13 Jun 2014 11:58:55 GMT
Keep-Alive:timeout=5, max=96
Server:Apache/2.2.22
Vary:Accept-Encoding,User-Agent

Content empty
So both client and server didn't have the content here.

Original comment by dino.pa...@gmail.com on 13 Jun 2014 at 11:31

GoogleCodeExporter commented 9 years ago
This can by the way be replicated here in incognito (did try that of course), 
so if it's anything... it's the server or something in between me and the 
server.

I'm playing around with some .htaccess now to see if i can disable apache 
caching (if that is the issue)

Original comment by dino.pa...@gmail.com on 13 Jun 2014 at 11:45

GoogleCodeExporter commented 9 years ago
I'm not sure what is happening, i need to try it out on another server. 
Something is ignoring my client and just serving me 304 and empty content.

Original comment by dino.pa...@gmail.com on 13 Jun 2014 at 2:27

GoogleCodeExporter commented 9 years ago
http://www.mrclay.org/ is serving both JS and CSS via minify and forced refresh 
shows no problem.

Original comment by mrclay....@gmail.com on 13 Jun 2014 at 2:36