Cache Manager Root Node - Long cache time not working?

I have a few asset listings that I want to act as static pages because they are large complicated listings. So, I set those root nodes in the cache manager with a very long cache time, 30 days. The problem is, that it does not seem like those files are cached. Each morning I try the file, and it takes about 20 seconds to load. Then, a second load is super quick. So, it almost seems like the settings I have set are not working.


My settings for that root node (asset) are:



Cache Status: Default

Default Expiry: 2592000

Browser Cache Expiry: Default



Any other ideas on how I can get this working correct?

Hey Nic, do you have proxy cache or just relying on matrix and the browser?


Can you re-run the tests after changing 'browser default' to be the same value as 'system default'?



I remember having a similar issue during client testing (browser wasnt caching) and enabling the second setting worked (which it shouldnt need to) - I never raised a bug at the time because I wasnt 100% certain it was me or the matrix instance at fault.



Also, you are running your tests in a public (not logged in) session? Assuming 'public level caching' is enabled in the cache manager?



Cheers



Scotty



Edit: can you make the pages available for us to look at?

[quote]
Hey Nic, do you have proxy cache or just relying on matrix and the browser?

[/quote]



FYI if there's a functioning proxy cache in front making the same request like this will normally retrieve the same dates each time:

    
    $ curl -sv http://www.puc.edu/enrollment 2>&1 | egrep '^(< Date|  Page generated):'
    < Date: Wed, 30 Mar 2011 23:19:13 GMT
      Page generated: 30 March 2011 16:19:13
    $ curl -sv http://www.puc.edu/enrollment 2>&1 | egrep '^(< Date|  Page generated):'
    < Date: Wed, 30 Mar 2011 23:19:18 GMT
      Page generated: 30 March 2011 16:19:19

[quote]
Hey Nic, do you have proxy cache or just relying on matrix and the browser?



Can you re-run the tests after changing 'browser default' to be the same value as 'system default'?



I remember having a similar issue during client testing (browser wasnt caching) and enabling the second setting worked (which it shouldnt need to) - I never raised a bug at the time because I wasnt 100% certain it was me or the matrix instance at fault.



Also, you are running your tests in a public (not logged in) session? Assuming 'public level caching' is enabled in the cache manager?

[/quote]



Thanks guys. Ok, here are a few details:


  • No proxy, just using Matrix cache.
  • Checked my Browser Cache Expiry in the cache manager and it is set to 0. Is this a bad thing?
  • It is a public session, and public caching has always been turned on



    Here is the URL: http://www.puc.edu/api/iphone/directory.xml



    That URL will be super fast now, but tomorrow after our matrix cache expires, it will be slow again until the cache is built.

[quote]
Thanks guys. Ok, here are a few details:


  • No proxy, just using Matrix cache.
  • Checked my Browser Cache Expiry in the cache manager and it is set to 0. Is this a bad thing?
  • It is a public session, and public caching has always been turned on



    Here is the URL: http://www.puc.edu/api/iphone/directory.xml



    That URL will be super fast now, but tomorrow after our matrix cache expires, it will be slow again until the cache is built.

    [/quote]



    I threw nocache on this, and to be honest it looks kinda normal for first page view on a complex asset listing that needs to build asset cache. Any way you can optimise your asset listing? Status selection(s) to avoid effective read check or some other cool tweaks as per http://www.puc.edu/api/iphone/directory.xml

    Edit: can you change your browser expiry setting to match the value entered for system default instead of ‘0’, and re-run tests? I Just want to see if the 0 = use default setting is actually working in your case.

[quote]
I threw nocache on this, and to be honest it looks kinda normal for first page view on a complex asset listing that needs to build asset cache. Any way you can optimise your asset listing? Status selection(s) to avoid effective read check or some other cool tweaks as per http://www.squizlabs.com/view?a=7741

Edit: can you change your browser expiry setting to match the value entered for system default instead of ‘0’, and re-run tests? I Just want to see if the 0 = use default setting is actually working in your case.

[/quote]



Scott, I understand that it will take a bit to load it the first time, but shouldn’t it then be cached for as long as I set the expiry? Shouldn’t it be fast, and never have to regenerate for the next 30 days (which is the length I set it to)?



I will make the change you suggested and see how it works.

Just a note that the URL seems to be cached for me. Takes under a second to start returning data.


Edit: Oh, it does actually cache for a day. So the timeout is wrong, which is confirmed by the response headers. Someone needs to check what order rules are applied in for the Cache Manager. Do you have any rules for this asset that might conflict, causing Matrix to pick a time?

[quote]
Just a note that the URL seems to be cached for me. Takes under a second to start returning data.



Edit: Oh, it does actually cache for a day. So the timeout is wrong, which is confirmed by the response headers. Someone needs to check what order rules are applied in for the Cache Manager. Do you have any rules for this asset that might conflict, causing Matrix to pick a time?

[/quote]



Yes, it only caches for a day.



What kind of rules do you mean?

[quote]

  • Checked my Browser Cache Expiry in the cache manager and it is set to 0. Is this a bad thing?

    [/quote]



    Hey Nic



    Can you please confirm the same issue exists if/when you tweak the following.



    Cache Status: Default —> uncheck default and leave the drop down select to 'On'

    Default Expiry: 2592000 —> play with days here try 28 or 34 days, i'm wondering/hoping its not a bug related to day(s)/month expiry

    Browser Cache Expiry: Default —> uncheck default and enter same values you enter for the above



    I know alot of that goes against what is expected on that screen and for its functionality, just trying to trouble shoot which one may be the cause, if any.



    Also, what version of matrix, maybe I can replicate on one of my locale test systems.



    Cheers



    Scotty

[quote]
What kind of rules do you mean?

[/quote]



Conflicting rules may = another cache manager customisation that may conflict like root node customisation on that assets parent(s) which may say 'apply to all children' or a asset specific customisation.

[quote]
Hey Nic



Can you please confirm the same issue exists if/when you tweak the following.



Cache Status: Default —> uncheck default and leave the drop down select to 'On'

Default Expiry: 2592000 —> play with days here try 28 or 34 days, i'm wondering/hoping its not a bug related to day(s)/month expiry

Browser Cache Expiry: Default —> uncheck default and enter same values you enter for the above



I know alot of that goes against what is expected on that screen and for its functionality, just trying to trouble shoot which one may be the cause, if any.



Also, what version of matrix, maybe I can replicate on one of my locale test systems.



[/quote]



Thanks I have changed these and now will have to wait to see if it works.



We are running 3.24.3.

[quote]
Thanks I have changed these and now will have to wait to see if it works.



We are running 3.24.3.

[/quote]



Ohhh hello world! My browser is now showing Cache-Controlmax-age=2592000, public in response headers for cache expiry versus your system wide 12 hour expiry it was showing before :slight_smile:



Edit… which setting was it, change 0 (for browser to use default) to 2592000? If so, this confirms a similar issue I had when testing cache customisations on a client system.

[quote]
Ohhh hello world! My browser is now showing Cache-Controlmax-age=2592000, public in response headers for cache expiry versus your system wide 12 hour expiry it was showing before :slight_smile:



Edit… which setting was it, change 0 (for browser to use default) to 2592000? If so, this confirms a similar issue I had when testing cache customisations on a client system.

[/quote]



Hooray!



I changed both defaults like you said, but I really think that it was changing from browser default of 0 to 2592000.



One last question. Will these caching rules take affect when dynamic parameters are used on this asset? With that dynamic request be given the same long cache if it is called again?

Dynamic parameters should work fine with caching too.


The cache key consists of current url, so below urls should be cached and have different cache entries.



example.com/test?rootid=1

example.com/test?rootid=2

[quote]
Dynamic parameters should work fine with caching too.



The cache key consists of current url, so below urls should be cached and have different cache entries.



example.com/test?rootid=1

example.com/test?rootid=2

[/quote]



And they will pick up my cache root node setting talked about in this post?