Page Caching: html_gzip only? limit cache size, lifetime, inode count?
-
We’re very happy with W3 Total Cache so far and use it for Object Caching, Browser Caching and HTML/JS/CSS minification. We’d also like to use the plugin for Page Caching but have some questions regarding our particular use case.
We’d like to use the enhanced page caching method which stores cached files to disk, i.e., in wp-content/cache/page_enhanced/.
For each page, W3TC creates a directory, a _index_slash_ssl.html file and a _index_slash_ssl.html_gzip file.
We have a large website and a limited inode count on the Linux server we’re using. We’d like to limit the inode count and disk space requirements to page-cache as many pages as possible (we cannot page-cache all of them).
1) Is it possible to only create .html_gzip files and no .html files? Whether via an existing or future plugin setting, or by editing the plugin .php or .htaccess files directly (if so, where)?
Now, as you know, the structure of the page cache is as follows:
page-type-dir/
—-slug-dir/
——–_index_slash_ssl.html
——–_index_slash_ssl.html_gzipWhich requires 3 inodes per page. Is there a particular reason for this structure (with the same filenames used for all pages)? For a large site like ours, a structure like this would be ideal:
page-type-dir/
—-slug.html
—-slug.html_gzip
Or even better, since most browsers support gzip compression:
page-type-dir/
—-slug.html_gzip
2) Any change you might (provide an option to) change this structure? Or could we modify the plugin .php ourselves easily to this end?
3) The page cache cannot be configured so that the cached pages are deleted (and not recreated unless there’s a new page request) after N minutes/hours/days, is that correct? We wrote a custom script that runs continuously on our server to enforce a cache lifetime of this sort (by deleting pages that are older than some specified time period), but are wondering whether this is possible with the plugin settings.
4) The goal here in general: Ideally, we would be able to only page-cache up to N of the most recently requested pages at any given point in time since we simply cannot cache all the pages we would like to cache currently. So being able to set a specific page/inode limit (and/or disk space limit) would be great. Setting a maximum cache lifetime for a page (ideally, starting from the last time it was requested, not the time when the cache files were created) would also be great.…so we’re wondering what your thoughts are on how to use W3TC in our particular use case. Thanks for reading!
EDIT: After posting this and doing some testing, we noticed that the suffix _old is appended to .html and .html_gzip files. This happens after the the time set for the Garbage Collection Interval (“If caching to disk, specify how frequently expired cache data is removed. For busy sites, a lower value is best.”)? Are these caches files/directories removed completely or recreated?
- The topic ‘Page Caching: html_gzip only? limit cache size, lifetime, inode count?’ is closed to new replies.