Static Page Caching 2.x

Legacy documentation for Static Page Caching 2.x.

By popular request, there is now a tag that will cache a page when it is loaded for the first time by ExpressionEngine. Simply place the tag within your template and when a page is created based on that template, Static Page Caching will create a cache for it. On the next page load, the cached version will then be displayed!

Parameters

The following parameters are available for use:

online_users_exceeds=

online_users_exceeds="50" 

If this parameter is set, the page will not be cached until the number of online users exceeds the amount specified. The calculated number of online users is taken from ExpressionEngine's native Stats module and includes logged in members and guests.

remove_string=

remove_string="home/" 

In the circumstance where you wish to remove a certain portion from the URL in the cached URI's that SPC generates with the Automatic_Cache tag, this parameter is available. A primary example of when you would want to use this is if you have a Template Group segment removed from URLs but added back in an .htaccess file, it will cause issues with your caching as the Automatic_Cache request will be incorrectly saved with the Template Group segment in the URI.

Examples

The following example will only cache the page when there is a third segment in the URL. For example, if you put this tag into a single entry view template, it would only cache a page when there is an entry ID or URL title included in the page's URI.

{if segment_3 != ""}
    {exp:static_page_caching:automatic_cache}
{/if}