Best practices for caching content
-
Dear Support,
On a busy site I’m trying to find the best compromise for caching content, but also be able to update some portions of the site without removing the whole cache, if possible.
My current settings are:
1) Advanced
Caching
Cache hits to this website for quick access. (Recommended)
Use mod_rewrite to serve cache files. (Recommended)
Miscellaneous
Compress pages so they’re served more quickly to visitors. (Recommended)
Cache rebuild. Serve a supercache file to anonymous users while a new file is being generated. (Recommended)
Q1:
Would it be worth to change the caching method to ‘Use PHP to serve cache files.’ and then to enable ‘304 Not Modified browser caching. Indicate when a page has not been modified since last requested. (Recommended)’? Would this have a positive impact on a site with a lot of posts? Also, would that other caching method use the APC installation that I’m usign to cache other projects?Advanced
Mobile device support. (External plugin or theme required. See the FAQ for further details.)
Clear all cache files when a post or page is published or updated.
Extra homepage checks. (Very occasionally stops homepage caching) (Recommended)
List the newest cached pages on this page.
Q2:
As far as I understand, if I want to include some dynamic content I should change the cache method to one of the other 2 choices (according to your FAQ). Would keeping the current one, but in conjunction with the ‘WP Widget Cache’ make the caching mode ‘Use mod_rewrite to serve cache files. (Recommended)’ work like the other two in respect to keeping some portions of the pages fresh?Q3:
What’s the ‘DO NOT CACHE PAGE secret key:’ for? Is there a way in which I could put that string inside a page and not have it cached? May I see a sample of the line I should add to a template?Expiry Time & Garbage Collection
Cache Timeout
86400 secondsScheduler
Clock: 00:00Interval:
Once Every Other WeekNotification Emails
Email me when the garbage collection runs.Q4:
Despite the description, I didn’t understand very well what this ‘Garbage Collection’ is and what’s the best way to configure it for a busy site like the one I have. Is the above setup right? If I have the cache timeout set to 2 days, but the scheduler to every 2 weeks @ 00:00 is it ok, or should I have also the timeout set to 2 weeks (in seconds)?2) Preload
Refresh preloaded cache files every 20160 minutes. (0 to disable, minimum 720 minutes.)
Preload all posts.
Preload mode (garbage collection only on legacy cache files. Recommended.)
Preload tags, categories and other taxonomies.
Send me status emails when files are refreshed.
Less emails, 1 at the start and 1 at the end of preloading all posts.
Q5:
Given the fact that here I’m setting up the preload to refresh cache files every 14 days (in minutes), I’m wondering if that should be coordinated with the ‘Garbage Collection’.Q6:
What would you recommend as a feasible solution for both ‘Preload’ and ‘Garbage Collection’?Thanks,
Mihai
- The topic ‘Best practices for caching content’ is closed to new replies.