Static Page Caching 2.x

Legacy documentation for Static Page Caching 2.x.

In the Static Page Caching module area, you can add, view, and manage cached URI's as well as control preferences for the add-on.

Cached URIs

The Homepage for the module will show you a list of all the currently cached URIs for each Site. A pulldown on the lefthand of the screen allows you to move between Sites without having to use the ExpressionEngine control panel's Sites tab and a search allows you to narrow down results. In case files are deleted from the file system manually (i.e. via (s)FTP), the module will check that the cached pages still exist in the file system and remove missing cached pages from the database.

If you wish to refresh the cached pages, simply choose the select box for each URI and click Refresh Cached URIs button The cache files will automatically be removed from the file system and the URIs will be put into the queue for re-caching.

If you no longer wish for certain URIs to be cached, simply choose the select box for each URI and click Delete Cached URIs button The cache files will automatically be removed from the file system and the URI removed from the list of cached URIs in the database.

Add URIs

While you can cache URIs via the module's tags on the front end templates, you can also submit a list of URIs to cache manually via the module's control panel. Simply submit your URIs, separated by a line break, and choose their Site. When you submit the form, the module will immediately cache those URIs for you.

Because of the amount of possible work required to cache a complete URI, we have a limit of submitting eight URIs at a time. Example URL structure (can be URL's or URI's):

http://site.com/news/article/the_bird_is_the_word
http://site.com/news/article/99
news/article/the_bird_is_the_word
news/article/99

Queue

In the Preferences section of the module, if you have the Renew Cache Files value set to anything other than Never, then your cache files will automatically be deleted after a certain period of time. When the cache file is deleted, we put the URI into the queue so that at the next opportunity the URI will be recached for you.

If you want to check the queue and re-cache URIs sooner, you can do so by clicking all of the URIs you wish to cache immediately, and click Cache Queued URIs.

Preferences

This section controls the Preferences for the module on a per-Site basis. All of these settings should be filled out for a Site to ensure that caching will work properly.

Preferred Data Fetching Method

This is the preferred way the page will be fetched from the server to retrieve the data for caching. Unless there is a problem fetching the data, you should leave it on Auto-Detect.

Server Path for .htaccess File

Path to the .htaccess file for this Site. Make sure this file exists and is writable.

URL for Cache Folder

When you installed Static Page Caching, you created a directory at the root of your site called static_page_caching. This is the URL to this directory.

Server Path for Cache Directory

When you installed Static Page Caching, you created a directory at the root of your site called static_page_caching. This is the file server to this directory.

Please make sure that your server paths are absolute server paths. It might be helpful to reference the SCRIPT_FILENAME value that can be found in the ExpressionEngine control panel's Admin section under PHP Info.

Renew Cache Files

When a page is cached, it is given a time stamp in the database. If you want a cached page to be renewed after a certain period of time choose that time interval here.

Importantly, the module will only check this when it is touched, i.e. the module's CP is loaded or one of its template tags is called. So, it might not be perfectly timed. Using the Check Queue tag on a popular page will help.

Smart Template Editing Enabled

Whenever a page in ExpressionEngine is cached by Static Page Caching, it totally skips ExpressionEngine, which means that if a template is edited or deleted the cached pages for that template will still exist and be displayed.

If this setting is enabled, when a template is edited Static Page Caching will remove any affected cached pages and put those URIs into the queue for re-caching. If a template or template group is deleted, it removes the caches for any affected pages entirely.

Smart Entry Editing Enabled

Whenever a page in ExpressionEngine is cached by Static Page Caching, it totally skips ExpressionEngine, which means that (unlike normal ExpressionEngine caching) if you edit an entry it will be displayed unchanged on cached pages.

If this setting is enabled, whenever an entry on this Site is edited Static Page Caching will search the templates for this Site and find any that might be affected and then put URIs for those templates into the queue for re-caching.

The pages that this setting will uncache will be those with Embeds and any Template tags using the channel parameter. Naturally, this will not take into account tags using ONLY the entry_id parameter or countless other ways of displaying entries, but it should assist with keeping your entry data up to date on cached pages.

Cron URL

This is the URL that you can ping from a cron to check / refresh the cached URI list / queue.

Documentation

A direct link to the online documentation for this add-on.