Is it possible to recache a whole site regularly at 4am or something? I was thinking maybe in the crontab, I just don't really know how to use the crontab so thought I'd ask first. Anyone got this happening?
Recaching a site
[quote]
Is it possible to recache a whole site regularly at 4am or something? I was thinking maybe in the crontab, I just don't really know how to use the crontab so thought I'd ask first. Anyone got this happening?
[/quote]
Yes, you can use the System Tool: Clear Matrix Cache to do this.
You need to set the root asset, "This asset and its children", and Repopulate. You also need to set the repeating job to every 1 days. But, the problem here is that it schedules the 1 day starting from the time you set this up. So, if you want it to work for 4am, you have to set this option at 4am.
Ah, took me awhile to find the system tools but now I see what you mean!
Yeah, having to do it the first time will be a bit of a bummer. ;p
So when I get up at 4am to do it should I leave 'clear now' unticked or tick it?
[quote]
Is it possible to recache a whole site regularly at 4am or something? I was thinking maybe in the crontab, I just don't really know how to use the crontab so thought I'd ask first. Anyone got this happening?
[/quote]
A silly question: why?
Do you have a really long cache time set in Matrix ?
cheers
Richard
I'd say it's not the good way to solve the caching issue but it's fine just for playing around the cron manager.
We have multiple sites, and our overall cache clear time is every six hours. The newest site has lots of asset lists that take ages to load, and it doesn't need its cache cleared as often. I figured recaching the thing early in the day would set it up so that the first bit of the day it would already be loaded, and hopefully staff access would keep the wait times blowing out for the rest of the day.
I don't want to increase the system-wide cache time because the other sites are going well on the six hour cache.
It looks interesting to me. If the cache for the page has not expired, it should be quick to load the page because the browser does not hit the Matrix but the proxy. The other thing I am not sure is that how to set a single site's cache expiry longer than the system wide setting, did you exclude the site URL from the proxy?
Good question! It's a possibility, as this site has been set up to work as a Single Sign On site with ldap.
How would I check that the URL is going through the proxy?
It can be told via the response header from the web developer plugin of FF. BTW, can I have more info about SSO? Does it mean the users login to Windows so they don't need to login to matrix for editing interface or restricted pages?
Sorry, can you tell me what I am looking for? I can see a line that says proxy connection: keep-alive, is that what you mean?
And yes, so staff log in to their computers in the morning and then they don't need to type in their password again when they go to Matrix. We're using kerberos to get it done. Don't know much about how it works, I pay Squiz and our Linux guru for that, which is why I am floundering now. ;p
After installing web developer, it's under the tab of "information" -> "view response headers", then you'll see a couple of line like,
Date: Tue, 18 May 2010 00:42:00 GMT Server: Apache/2.2.3 (Red Hat) X-Powered-By: PHP/5.1.6 Expires: Tue, 18 May 2010 01:42:00 GMT Cache-Control: max-age=3600, public Pragma: cache Content-Type: text/html; charset=iso-8859-1 Age: 317 Content-Length: 35519 X-Cache: HIT from xx xx X-Cache-Lookup: HIT from xx xx Via: xx xx 200 OK
The last five lines after "content-type" are what you look for.Thanks for the information for the SSO
This is what mine says:
Date: Tue, 18 May 2010 02:29:11 GMT Server: Apache/2.2.8 (Ubuntu) X-Powered-By: PHP/5.2.4 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Set-Cookie: SQ_SYSTEM_SESSION=9e1d3a25918685c2588ea53c051ef3f0; domain=internal.url; path=/; Content-Type: text/html; charset=iso-8859-1 X-Cache: MISS from proxy.domain.com X-Cache-Lookup: MISS from proxy.domain.com:3128 Proxy-Connection: close 200 OK
I assume this is not good news...
The weird thing is that the public site says the same thing.
Can you cache without having a proxy? Maybe that is what we're doing.
It seems to me a logged-in session. Did you check the response header after login to Matrix? Would you re-check the header without login?
That is actually quite hard to do, because the site is not available unless you are verified by the SSO. I tried but didn't get much different to what was above.
Thank you heaps for your assistance, Robin, but I think this is over my head and I will lodge a ticket with Squiz.
The response header trick is cool, thanks for teaching me.
Is it hard?
I've never dealt with logged-in users before so if there are issues I know not of them.
I think Aleks was talking about the public version cache over the login version cache. If your site has been restricted to staff only, thus it doesn't have the public version cache and there is no such issue. For the nested asset listing, you can get rid of the caching issue by nesting them in the design area. Anyway let's see what Squiz support says.