Caching Fixes

Written By: - Date published: 10:30 am, December 10th, 2008 - 15 comments
Categories: admin - Tags: ,



There has been a on-going issue with some readers not getting updates through in a timely fashion in the sidebars when posts and comments are updated. A similar issue has shown with people using the same proxy server winding up sharing their cookies. I’ve checked the back end caching throughly so I’m confident that it is not on the server side, and is out on the client side.

I’ve changed the .htaccess to consider everything to be non-cached unless stated otherwise (images, css, javascript), to expire at time of access (ExpiresDefault “access”). To assist with the older and dumber caching proxies, I’ve also put a plugin to add the following header lines to the HTML of dynamic pages:-

<META Http-Equiv=’Cache-Control’ Content=’no-cache’>
<META Http-Equiv=’Pragma’ Content=’no-cache’>
<META Http-Equiv=’Expires’ Content=’0′>

If anyone continues to have problems in a few days, could they put a comment on this post.

Any other suggestions for html headers from the web savvy that will help would be greatly appreciated. This is not an area that I’m familiar with, but I’m having to learn. So far it looks like an ad-hoc mess with as many systems violating the standards. I will not be putting in this suggestion from microsoft, of adding an extra header and body although it does work.

The fix went in at 1930 last night, but I scheduled this post for later as it is unlikely to cause any changes in the short-term.There are some lively discussions ongoing.

15 comments on “Caching Fixes”

  1. Graeme 1

    I’m still having to hard refresh every time I go to the homepage, or follow a link to a comment thread. I assume this is what was supposed to have been fixed?

  2. lprent 2

    Yes. What browser and general version are you using?  I’m betting Internet Explorer 6

  3. insider 3

    Me too. I didn’t want to botehr you as I thought it was just me.

    ALso when I click on a new comment on the sidebar. If I have viewed the page before it will take me to the top of the relevant page but then all the new comments on the sidebar disappear as it appears to go back to a cached version – I have to actually refresh the page to see the new comment and latest sidebar.

    I am on IE6.0.2900

  4. DeeDub 5

    Same problem: Opera Version 9.61

  5. MikeG 6

    I’m still having problems – IE 7.0.5730.13.

    At home I’m use Firefox 3 and have similar issues.

  6. Tane 7

    Mine seems to be fixed – using Firefox

    Thanks Lynn.

  7. lprent 8

    Ok, tonight I’ll add in the ‘fix’ from microsoft (urrggghh puke). I used that two years ago and it fixed all of the problems with caching for IE. The fix is meant to only be for IE browsers before 6, however I found it was effective on IE6 and on the betas for IE7. I was writing webapps hooking onto very large live data sets where caching behaviours was a real pain.

    I’ll restrict the mickeysoft hack to IE and Opera. Rather than put a new post up I’ll amend this post – so look back here tommorrow.

    MikeG: did the firefox 3 show up since about 20:00 last night? I mostly use firefox 3 at present (because of the Alexa test). That is one browser that should obey the caching rules.

  8. bill brown 9

    Using ff3, marked difference from yesterday – no problems so far with comments list today.

  9. MikeG 10

    lprent – Sorry for the delay in answering.

    I’m fairly sure that the problem on ff 3.0.4 was evident before 20:00 last night. It’s certainly still there now – the home page shows 1 comment for the “Arrogant and out of touch post”, but there are 9 comments on the thread.


    EDIT: and this comment didn’t show up straight away like they normally do – I thought I must have got the captcha wrong until I hit refresh.

  10. lampie 11

    Still a problem 🙁

  11. Matthew Pilott 12

    Yeah I.E 6 and it’s all over the place I’m afraid Lynn. Half the time the site will stay the same for a good day, sometimes if I go to a post I can see other ones that weren’t there when I went to the home page. I find I just can’t get to pages that are there though, click the link and I get an old version with no comments…

  12. lprent 13

    Sorry didn’t get onto it last night. My partner got caught in some tides and consequent flooding in PNG. Tonight hopefully there will be no interruptions

    Update: and then the phone rang…

  13. Anita 14

    I’m still having issues with the right hand column not updating.

    Safari 3.2.1
    Mac OS X: 10.5.5

    Best wishes to your partner and everyone else struggling in PNG right now.

  14. Anita 15

    Today a certain government organisation is forcing me to use Internet Explorer 7 on Windows, and the caching issues are really really (really!) bad. This organisation runs caching-proxies. I think they have more than one layer, but it might be proxy -> caching proxy -> proxy, so I’m not sure where the caching is coming from, but it’s horrid!

    If I get an old page and Shift-refresh I get the up-to-date version, but if I then hit refresh I go back to an old version of the page. I have great experiences like following a comment link from the right hand column and getting to a page which doesn’t have that comment on it.

    I seriously wouldn’t read The Standard if I had to put up with this.

Recent Comments

Recent Posts

  • Cameras on vessels to ensure sustainable fisheries
    Commercial fishing vessels at greatest risk of encountering the rare Māui dolphin will be required to operate with on-board cameras from 1 November, as the next step to strengthen our fisheries management system. Prime Minister Jacinda Ardern and Fisheries Minister ...
    2 weeks ago
  • Greatest number of new Police in a single year
    A new record for the number of Police officers deployed to the regions in a single year has been created with the graduation today of Recruit Wing 326. Police Minister Stuart Nash says the graduation of 78 new constables means ...
    2 weeks ago
  • Ensuring multinationals pay their fair share of tax
    New Zealand is pushing on with efforts to ensure multinational companies pay their fair share of tax, with the release of proposed options for a digital services tax (DST). In February Cabinet agreed to consult the public on the problem ...
    2 weeks ago