We chat with Blizzard's Hearthstone team on all the juicy info about the first expansion to highly-successful card game Hearthstone
Hearthstone: Goblins vs Gnomes Dev Interview
Follow on for our second entry in the on-going review of World of Warcraft's fifth expansion, Warlords of Draenor
World of Warcraft: Warlords of Draenor: Day 8 - Garrisons
We chat with Blizzard's Hearthstone team on all the juicy info about the first expansion to highly-successful card game Hearthstone
Hearthstone: Goblins vs Gnomes Dev Interview
We take a nostalgic look back at one of the best N64 games to ever be made, The Legend of Zelda: Majora's Mask
Throwback Thursday - The Legend of Zelda: Majora's Mask
chrome script cache issues
arkter
Gold Coast, Queensland
392 posts
Have any of you guys noticed this? Chrome seems to be caching external php & javascript files regardless of headers...

for example... php headers for an external script, but they are still being cached locally.

header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store' );
header( 'Pragma: no-cache' );

For once, everything works perfectly in IE & FF... however chrome caching these files is generating a major pain my a****** for every second real-time data updates. Have any of you encountered this problem or found a work around? even using JS and some random math for files hasn't fixed it. I have tried google but even 'php gurus' are pulling their hair out over it.
08:47pm 05/01/12 Permalink
system
Internet
--
08:47pm 05/01/12 Permalink
skythra
Brisbane, Queensland
5031 posts
Chrome also seems to cache DNS entries so if i change my dns from my work one to googles one (8.8.8.8) then it won't update.

Frustrates me to hell, but firefox and IE lag on my single core work laptop which is actually what i use as a desktop.. derp.
09:04pm 05/01/12 Permalink
arkter
Gold Coast, Queensland
393 posts
I remember dealing with this issue in 2007 with firefox... seems a bit retarded that it is happening in 2012 in chrome.
09:26pm 05/01/12 Permalink
Skitza
Brisbane, Queensland
9680 posts
Put in a bug check with the chrome guys, they do respond, they are actually really good.
10:48pm 05/01/12 Permalink
arkter
Gold Coast, Queensland
394 posts
Put in a bug check with the chrome guys, they do respond, they are actually really good.


Some of the guys are saying this bug has been lodged for a -long- time and keeps getting looked over every release... I'll put another one in I guess.
11:17pm 05/01/12 Permalink
teq
Brisbane, Queensland
12247 posts
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store' );
header( 'Pragma: no-cache' );



try this instead

header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', true, 200);


send "200 OK" instead of "304 Not modified"

Chrome also seems to cache DNS entries so if i change my dns from my work one to googles one (8.8.8.8) then it won't update.


you have to close chrome and do "ipconfig /flushdns" from the command prompt, then re-open chrome = fresh dns
12:04am 06/01/12 Permalink
skythra
Brisbane, Queensland
5034 posts
you have to close chrome and do "ipconfig /flushdns" from the command prompt, then re-open chrome = fresh dns

Yes you do and it's annoying all the time (i swap dns's 3-4 times a day). At least i can turn chrome to restore closed tabs..
12:51am 06/01/12 Permalink
teq
Brisbane, Queensland
12248 posts
save it in a bash script?
set it up so you click a button to change your dns, close chrome, flush dns, re-open chrome in one hit
12:54am 06/01/12 Permalink
arkter
Gold Coast, Queensland
395 posts
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT', true, 200);


Still no joy in chrome, I set up a bit of a simple test site to see if I can figure out what's going on... simple php script to load a random image from a folder, called using the php file as the img src.

Again, works perfectly in IE & FF, if you refresh, click a refresh page link and even using auto refresh headers loads a new image every time. Not in chrome though, stale information seems to get stuck in the cached script for about 1 - 2 minutes. CTRL + F5 loads a new image every time which still brings me to believe that chrome is just completely ignoring these headers.

Might just have to do a bit more research and see how other people are getting around this.
08:52am 06/01/12 Permalink
trog
AGN Admin
Brisbane, Queensland
35382 posts
Chrome caches VERY aggressively compared to Firefox etc, I find.

Generally speaking if I CTRL-F5 two or more times directly in a row, it forces a cache refresh. In other browsers a CTRL-F5 is a signal to refresh everything all at once, but in Chrome it seems you have to do it a couple times in a row before it really decides to pay attention.

Another option is to hit CTRL-SHIFT-DELETE and you'll get a deletion dialog giving you options to delete cache. You can delete just for the last hour, which is handy for webdev stuff.
12:04pm 06/01/12 Permalink
arkter
Gold Coast, Queensland
396 posts
Chrome caches VERY aggressively compared to Firefox etc, I find.

Generally speaking if I CTRL-F5 two or more times directly in a row, it forces a cache refresh. In other browsers a CTRL-F5 is a signal to refresh everything all at once, but in Chrome it seems you have to do it a couple times in a row before it really decides to pay attention.

Another option is to hit CTRL-SHIFT-DELETE and you'll get a deletion dialog giving you options to delete cache. You can delete just for the last hour, which is handy for webdev stuff.


The problem is I can't tell every one else using the service to CTRL+F5 every few seconds if they use chrome lolol
12:12pm 06/01/12 Permalink
teq
Brisbane, Queensland
12249 posts
some internets pages are telling me chrome caches POST requests differently, are you POSTing to this particular page?
can you try using GET instead?


I use GET for my dynamic graph pages and I've never had this problem, but it could just be a coincidence
12:25pm 06/01/12 Permalink
arkter
Gold Coast, Queensland
397 posts
some internets pages are telling me chrome caches POST requests differently, are you POSTing to this particular page?
can you try using GET instead?


I use GET for my dynamic graph pages and I've never had this problem, but it could just be a coincidence


I'll bugger around on the php image test site I whipped up and let you know the results, cheers for suggestion.
12:57pm 06/01/12 Permalink
trog
AGN Admin
Brisbane, Queensland
35384 posts
The problem is I can't tell every one else using the service to CTRL+F5 every few seconds if they use chrome lolol
ah, sorry, I didn't read your problem properly.
01:29pm 06/01/12 Permalink
Plasma
1342 posts
You can bust through all caches by doing a HTTP POST to the data source (even if you're just fetching data and really mean GET) as the proxy won't return a cached response.

I'd be surprised if that doesn't work for you.
02:20pm 06/01/12 Permalink
system
Internet
--
02:20pm 06/01/12 Permalink
AusGamers Forums
Show: per page
1
This thread is archived and cannot be replied to.