News:

CRITICAL UPGRADE CPG RELEASE 1.6.30
Version 1.6.30 removes a serious security issue that could allow unauthorized access to modify your site. Upgrade as soon as possible.

Main Menu

Theme Cache Extended

Started by phill104, Yesterday at 08:44:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

phill104

A hevaily changed version of the excellent theme cache plugin by ron4mac ( https://coppermine-gallery.com/forum/index.php/topic,80231.0.html ), this was created by myself and one of the graduates where I work, Jenny. To be fair, she did most of the work here.

*
 * Caches index.php and thumbnails.php for visitors who are not logged in.
 * Based on Theme Cache 1.1 by {ron4mac}.
 *
 * Changes and additions in this extended version.
 *  - cache is checked at 'page_start' (before the page's own queries) instead of in pageheader(),
 *    which on index.php runs only after all the work is done
 *  - pages are saved from the core 'page_html' filter, so error pages (cpg_die) are never cached
 *  - cache key built from a whitelist of parameters plus language, theme, sort order and cookie consent;
 *    any other parameter (search, lang=, theme=, file=, uid=, ...) disables caching for that request
 *  - favourites, random, search and other per-visitor meta albums are never cached
 *  - atomic writes, stale-while-revalidate (one request rebuilds an expired page, others get the old copy)
 *  - Last-Modified / 304 support
 *  - cache cleared after uploads, edits, deletes, comments and any admin form submission
 *  - expired files removed automatically, number of files capped
 *  - optional .htaccess static mode: Apache serves guest pages with no PHP and no MySQL connection

If you have the original version of Theme Cache installed, follow the instructions in the readme for migrating to this. The naming has been kept the same as having two different versions installed at the same time would cause problems.
It is a mistake to think you can solve any major problems just with potatoes.