Dean Hiller
Dean Hiller

Reputation: 20210

js files being requested instead of using cache directly

I am using chrome to load a web page twice. On the second load, I still see all the js files being requested with 304 of course returned. I see the css files NOT requested and just load from cache. why is my js not loading from cache?

From chrome, here is the request/response on the second time(and on the third time it is re-requested instead of listenting to cache-control:max-age=3600

Request URL:http://myextremestore.com/public/js/bootstrap/theme.js
Request Method:GET
Status Code:304 Not Modified
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4
Cache-Control:max-age=0
Connection:keep-alive
Cookie:_ga=GA1.2.1887017343.1389240672; _usrp_dbba204e-e224-4c2e-9715-  645207f1698c_0=eyJMYXN0VmlzaXRUaW1lIjoxMzg5ODEwNzk2LCJTZXNzaW9uTnVtYmVyIjoxNCwiSXNTZXNzaW9uVmlzaXRMb2dnZWQiOmZhbHNlLCJUcmllZFRvSW52aXRlIjp0cnVlLCJTZXNzaW9uUGFnZVZpZXciOjE1LCJUb3RhbFBhZ2VWaWV3Ijo1MywiTG9jYWxRdWFyYW50aW5lIjpudWxsLCJXYXNJbml0QW1pbmF0aW9uIjp0cnVlfQ==; PLAY_SESSION="4c82c3ec3facde8b5cdd167313527d0b9b7b91df-s=500&___AT=df52f59436377f3500fb5700808f35bd5631e539&key=dean%40buffalosw.com"
Host:myextremestore.com
If-Modified-Since:Wed, 08 Jan 2014 18:48:42 GMT
If-None-Match:"1389206922000-1544568346"
Referer:http://myextremestore.com/admin/products
User-Agent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Here is the response

Response Headersview source
Cache-Control:max-age=3600
ETag:"1389206922000-1544568346"
Server:Play! Framework;master-5afad9b;prod

I am testing this on http://myextremestore.com and for some reason firefox is working just fine and I only see a single request server side when using firefox but chrome keeps asking for the same js files.

IE11 is working just fine as well. This is very weird.

Any ideas appreciated. thanks, Dean

Upvotes: 0

Views: 58

Answers (1)

Dean Hiller
Dean Hiller

Reputation: 20210

oh, so it turns out in chrome hitting enter in the url window results in same behavior as pushing the refresh button!!! In firefox, hitting enter in the url does NOT result in hitting the refresh button.

I do not however know why chrome on refresh is only asking for js files and not asking for css files...that seems weird. Anyways, it works as I expect now.

Upvotes: 1

Related Questions