Cache Issues

Recently, I have been seeing some strange caching issues with Firefox. We update our homepage/image quite often, but even days after the update, refreshing Firefox does not show the changes. Now, it could just be firefox, but I just wanted to make sure that our header settings are correct.


Here is what we use:



Send Cacheable Header Yes

If enabled, server will send cacheable Cache-Control and Pragma headers.

Send Last-Modified Header Yes

If enabled, server will send a timestamp indicating when the asset was last modified.

Send Not Modified Status-Code Yes

If enabled, server will send a "304 Not Modified" Status-Code indicating nothing has been changed since last visit.

Note: Only applicable to Live assets that are accessible by public users.

Send no-cache header for File assets No

If enabled, the "no-cache" Cache-Control option will be sent when serving File asset types. This option can be used to resolve inline file display issues in Internet Explorer.

Send 404 Cacheable Header No

If enabled, server will send cacheable Cache-Control and Pragma headers for 404 response to allow Proxy server to cache.



Does anyone have thoughts on this, or if anything should be changed? Or, why pages that have been updated days ago would not update in a browser. When I am sure the last modified has been updated on the pages.

I was having similar trouble our settings are now very similar + Cache Manager - details - Cache Options


Default Expiry 3600



Browser Cache Expiry 180

Hi Nic,


Get a hold of Firebug (if you do not have it) and use that to inspect the headers that you get on pages.



It will confirm that they are correct (if they are).



cheers,



Richard

Is you homepage built using nested content and/or asset listings?


The Last-Modified: header sent to the browser seems to be the newest last_updated date stored in the database for all constituent assets. This doesn't seem to always work though, and means a really old Last-Modified header gets sent to the browser.

[quote]
Is you homepage built using nested content and/or asset listings?



The Last-Modified: header sent to the browser seems to be the newest last_updated date stored in the database for all constituent assets. This doesn't seem to always work though, and means a really old Last-Modified header gets sent to the browser.

[/quote]



The home page is lots of things. Nested content, asset listings, nested calendar listings, etc. So, are you saying that since we just update parts of the homepage, such as images that get pulled in through an asset listing, that the entire page might not get a last-modified header?

I am subscribing this topic, very anxious to know the answer. We need the cache expert stands out to shed the light.

[quote]nickobec Browser Cache Expiry 180 [/quote]. I think 180 is still a bit aggressive setting but I did it worse. I set this value to '10' then crashed the server.:lol:’ /> <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/laugh.gif’ class=‘bbc_emoticon’ alt=':lol:

Ok guys, I got another report of a user not being able to refresh our homepage. They are getting a very old version of it from last year.


When checking the Last-Modified header, it is from 2009. We only update asset listings nested inside the homepage, so does this mean that the Last-Modified header never gets updated?



How can I force it to update if this is going to be an issue for other browsers?



Strangely, this seems to only have started happening after our upgrade to 3.24.3.

[quote]
Ok guys, I got another report of a user not being able to refresh our homepage. They are getting a very old version of it from last year.



When checking the Last-Modified header, it is from 2009. We only update asset listings nested inside the homepage, so does this mean that the Last-Modified header never gets updated?



How can I force it to update if this is going to be an issue for other browsers?

[/quote]

The page in which the content is nested won't receive a new header as it has not been modified.



Perhaps set up a Trigger to clear the cache on the outer page when an update occurs on the nested listings. Hopefully the listings are under one Root Node. The trigger should be restricted by Asset Type.


[quote]

Strangely, this seems to only have started happening after our upgrade to 3.24.3.

[/quote]

I haven't found anything in the 3.24.3 changelog which suggests a modification to caching for this release.

Just wondering if it will help to disable "Send Last-Modified Header"?

Hi guys,


Today I saw the VERY old homepage in IE with my home computer. I tried refresh(not hard refresh) quite a few times but it didn’t get the new content. Our homepage uses nested asset listing pages.



I am quite sure this is caused by the browser cache because after I cleared the browser cache and revisit the homepage it looked updated. Here is the header for the homepage, can I have some clue? :blink:’ /> <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/blink.gif’ class=‘bbc_emoticon’ alt=’:blink:


    
    Date: Tue, 02 Mar 2010 10:33:04 GMT
    Server: Apache/2.2.3 (Red Hat)
    X-Powered-By: PHP/5.1.6
    Expires: Tue, 02 Mar 2010 11:33:04 GMT
    Cache-Control: max-age=3600, public
    Pragma: cache
    Last-Modified: Fri, 13 Nov 2009 07:01:04 GMT
    Content-Type: text/html; charset=iso-8859-1
    Age: 136
    Content-Length: 34785
    X-Cache: HIT from our.proxy.server
    X-Cache-Lookup: HIT from our.proxy.server:80
    Via: 1.0 our.proxy.server:80 (squid/2.6.STABLE21)
    
    200 OK

[quote]
Hi guys,



Today I saw the VERY old homepage in IE with my home computer. I tried refresh(not hard refresh) quite a few times but it didn’t get the new content. Our homepage uses nested asset listing pages.



I am quite sure this is caused by the browser cache because after I cleared the browser cache and revisit the homepage it looked updated. Here is the header for the homepage, can I have some clue? :blink:’ /> <img src=‘http://forums.matrix.squiz.net/public/style_emoticons/<#EMO_DIR#>/blink.gif’ class=‘bbc_emoticon’ alt=’:blink:[/quote]



Your issue is here:


    Last-Modified: Fri, 13 Nov 2009 07:01:04 GMT


...but I can't remember what I did to fix it, other than manually fiddling with database entries :-)

We have this same issue, as our homepage also uses tons of nested content, and we don't actually update the "home" asset. Old versions of IE are an issue.


But, I do with there was a way to update the last modified date on it without actually editing it…

[quote]
We have this same issue, as our homepage also uses tons of nested content, and we don't actually update the "home" asset. Old versions of IE are an issue.



But, I do with there was a way to update the last modified date on it without actually editing it…

[/quote]



I remember how I resolved it for our intranet.



Created a trigger to execute when the status of any page underneath our news folder changed to live.



Trigger is set to execute a database query (you will need the data package installed to be able to do this):


    UPDATE sq_ast SET updated = NOW(), updated_userid = %globals_user_assetid% WHERE assetid = 19458


19458 is the site asset for our intranet.

Thanks guys for the help. I think the issue was really caused by last_modified field in the response header. The revisit of a page hits the Squid proxy but that field stops the browser downloading the content if there is old timestamp.
I am thinking if it'll help to disable "Send Last-Modified Header"in system configuration. If there is no last_modified filed in header, the browser may hit and request the content from the Squid proxy. The only thing I am not sure is if there will be a side-effect that pushes the Squid proxy refresh the cache with Matrix cache, which will quickly crash down Matrix.

I've checked some websites like yahoo and smh, they don't send last_modified field in the head so I reckon it's not required.

Thanks in advance.

:rolleyes:

[quote]
Thanks guys for the help. I think the issue was really caused by last_modified field in the response header. The revisit of a page hits the Squid proxy but that field stops the browser downloading the content if there is old timestamp.

I am thinking if it'll help to disable "Send Last-Modified Header"in system configuration. If there is no last_modified filed in header, the browser may hit and request the content from the Squid proxy. The only thing I am not sure is if there will be a side-effect that pushes the Squid proxy refresh the cache with Matrix cache, which will quickly crash down Matrix.

I've checked some websites like yahoo and smh, they don't send last_modified field in the head so I reckon it's not required.

Thanks in advance.

:rolleyes:

[/quote]



That may work, also you can disable 304 headers.



There is code that is supposed to detect modifications in any constituent assets, but I think there must be some circumstances where this does not work. You could file a bug on this.

Thanks Justin, I will contact Squiz support.

Hi guys,


Just a quick update that we did what Justin Cormack suggested. It works perfect. Happy time now (some clients said it’s the first time they saw the updated content in the nested lists).



We will keep monitoring the server load and get all of you updated.



Thank you Justin!



Robin

I've also been having this issue with my site where items nested don't appear on the homepage or those that have been archived are not disappearing. I'm on 3.22.3. Do I need to contact support to get this fixed or is this something that can be done within the CMS?