Simple Page Cache

Àpèjúwe

Simple Page Cache is an extremely simple, super-fast page cache for WordPress. The plugin stores full HTML pages on disk for non-logged-in visitors. The cache is automatically cleared when content is updated, ensuring visitors always see fresh content. Ideal for small to medium-sized sites and webshops that want maximum speed without complex settings.

Main features:
Ìtumọ̀ Yorùbá: – Caching for non-logged-in users (GET requests only)
Ìtumọ̀ Yorùbá: – Path-based cache structure for nginx direct serving (/host/path/index.html)
Ìtumọ̀ Yorùbá: – Cache files are stored in /wp-content/uploads/simple-page-cache/
Ìtumọ̀ Yorùbá: – Drop-in (advanced-cache.php) for maximum speed before WordPress loads
Ìtumọ̀ Yorùbá: – Nginx configuration generation for direct cache serving
Ìtumọ̀ Yorùbá: – Automatic cache clearing when posts/pages are updated
Ìtumọ̀ Yorùbá: – E-commerce integration with intelligent cache clearing for:
Ìtumọ̀ Yorùbá: – WooCommerce (orders, stock updates, product changes)
Ìtumọ̀ Yorùbá: – Easy Digital Downloads (purchases, download updates)
Ìtumọ̀ Yorùbá: – BigCommerce for WordPress (product updates)
Ìtumọ̀ Yorùbá: – Generic e-commerce plugins (product post types)
Ìtumọ̀ Yorùbá: – Automatic detection of dynamic pages (cart, checkout, account, wishlist) for:
Ìtumọ̀ Yorùbá: – WooCommerce
Ìtumọ̀ Yorùbá: – BigCommerce for WordPress
Ìtumọ̀ Yorùbá: – Easy Digital Downloads
Ìtumọ̀ Yorùbá: – iThemes Exchange
Ìtumọ̀ Yorùbá: – Jigoshop
Ìtumọ̀ Yorùbá: – WP-Shop
Ìtumọ̀ Yorùbá: – Detected dynamic pages are automatically excluded from caching
Ìtumọ̀ Yorùbá: – Manual cache clearing via admin bar button
Ìtumọ̀ Yorùbá: – Nginx config regeneration via admin bar button
Ìtumọ̀ Yorùbá: – Performance comments in cached HTML files
Ìtumọ̀ Yorùbá: – No complex settings, no database writes

Nginx Configuration

For maximum performance, you can configure nginx to serve cached files directly without PHP processing:

  1. Copy the nginx configuration from /wp-content/uploads/simple-page-cache/nginx.conf
  2. Add the configuration to your nginx server block for your domain
  3. Test nginx configuration: sudo nginx -t
  4. Reload nginx: sudo systemctl reload nginx

The nginx configuration includes:
Ìtumọ̀ Yorùbá: – Internal location block for serving cached files
Ìtumọ̀ Yorùbá: – Automatic cache bypass for logged-in users
Ìtumọ̀ Yorùbá: – Automatic cache bypass for requests with query strings
Ìtumọ̀ Yorùbá: – Debug headers to identify cache hits

Benefits of nginx direct serving:
Ìtumọ̀ Yorùbá: – Faster response times (no PHP processing)
Ìtumọ̀ Yorùbá: – Lower server load
Ìtumọ̀ Yorùbá: – Better scalability
Ìtumọ̀ Yorùbá: – Direct file serving from disk

How it works

  • For every non-logged-in visitor and every GET request, a static HTML file is created and served.
  • Path-based cache structure: Cache files are organized as /host/path/index.html for direct nginx serving.
  • Pages with characteristics of dynamic e-commerce pages (such as cart, checkout, account, wishlist) are automatically detected and excluded from caching. The plugin recognizes WooCommerce, BigCommerce, Easy Digital Downloads, iThemes Exchange, Jigoshop, and WP-Shop.
  • The list of excluded pages is automatically maintained in a file in the cache directory.
  • Automatic cache clearing: When posts or pages are updated, the plugin efficiently clears cache using the new path-based structure and scans for related content.
  • E-commerce integration: For WooCommerce, when orders are placed or product stock is updated, the plugin automatically clears cache for the affected products and related pages (categories, tags, shop pages, homepage).
  • Performance comments: Each cached HTML file includes a comment with timestamp and host information for debugging and transparency.
  • Nginx integration: Generated nginx configuration allows direct serving of cached files without PHP processing for maximum performance.

Clearing the cache

  • Click the “Clear Page Cache” button in the admin bar (visible to administrators only) to remove all cache files.
  • Click the “Regenerate nginx.conf” button in the admin bar to regenerate the nginx configuration file.

Deactivation

  • When deactivating the plugin:
    • The drop-in advanced-cache.php is removed.
    • The define('WP_CACHE', true); line (if placed by this plugin) is removed from wp-config.php.

Ìgbéwọlẹ̀

  1. Upload the plugin to the /wp-content/plugins/simple-page-cache/ directory.
  2. Activate the plugin through the WordPress plugins screen.
  3. Upon activation:
    • The cache directory is created (/wp-content/uploads/simple-page-cache/).
    • The drop-in advanced-cache.php is placed in /wp-content/.
    • define('WP_CACHE', true); is automatically added to wp-config.php (or replaced if it already exists).
    • An nginx.conf file is generated in the cache directory for nginx direct serving.

FAQ

Are pages automatically removed from the cache?

Yes! The plugin automatically clears cache when posts/pages are updated. For e-commerce sites, it also clears cache when orders are placed or product stock changes.

Can I manually exclude pages?

The plugin automatically detects most dynamic e-commerce pages. Manual exclusion is not possible without editing code.

Does this work with other cache plugins?

Always use only one page cache plugin/drop-in at a time.

How does the automatic cache clearing work?

The plugin scans all cached HTML files and looks for URLs that match the updated content. This ensures that any page linking to the updated content is refreshed.

What happens when a product goes out of stock?

For WooCommerce sites, when a productÌtumọ̀ Yorùbá: ’s stock status changes, the plugin automatically clears cache for that product page and all related pages (categories, shop pages, homepage) that might display the product.

Àwọn àgbéyẹ̀wò

Kò sí àwọn àgbéyẹ̀wò fún plugin yìí.

Àwọn Olùkópa & Olùgbéejáde

“Simple Page Cache” jẹ́ ètò ìṣàmúlò orísun ṣíṣí sílẹ̀. Àwọn ènìyàn wọ̀nyí ti ṣe ìkópa sí plugin yìí.

Àwọn Olùkópa

A ti túmọ̀ “Simple Page Cache” sí èdè agbègbè 1 kan. Ọpẹ́lọpẹ́ fún àwọn atúmọ̀ èdè fún àwọn ìkópa wọn.

Túmọ̀ “Simple Page Cache” sí èdè rẹ.

Ṣe o nífẹ̀ẹ́ sí ìdàgbàsókè?

Ṣàwárí koodu, ṣàyẹ̀wò ibi ìpamọ́ SVN, tàbí ṣe àgbékalẹ̀ sí àkọsílẹ̀ ìdàgbàsókè nípasẹ̀ RSS.

Àkọsílẹ̀ àwọn àyípadà

1.1.1

  • Bug fix: Fixed 404 errors when browsing the website while logged in
  • Query parameter handling: Plugin now properly checks for $_GET parameters and skips caching for requests with query strings

1.1.0

  • Path-based cache structure: Cache files now use /host/path/index.html structure for nginx direct serving
  • Nginx configuration generation: Automatic generation of nginx.conf file for direct cache serving
  • Nginx admin management: Added “Regenerate nginx.conf” button in admin bar
  • Improved cache clearing: Optimized cache clearing using new path-based structure
  • Better performance: Cache files can now be served directly by nginx without PHP processing
  • Enhanced documentation: Added nginx configuration section to readme
  • Cache directory change: Moved cache directory to /wp-content/uploads/simple-page-cache/ for better compatibility

1.0.3

  • Automatic cache clearing: Cache is now automatically cleared when posts/pages are updated
  • E-commerce integration: Added intelligent cache clearing for WooCommerce, Easy Digital Downloads, and BigCommerce
  • HTML content scanning: Implements precise cache clearing by scanning HTML content for URLs
  • Performance optimization: File size filtering and optimized scanning for better performance
  • Cache transparency: Added performance comments to cached HTML files with timestamp and host info
  • WooCommerce support: Automatic cache clearing for orders, stock updates, and product changes
  • Generic e-commerce support: Works with any plugin using product post types
  • Webshop optimization: Handles large product overview pages efficiently

1.0.2

  • Enhanced caching logic with HTTP status code validation
  • Skip caching for redirects (3xx status codes)
  • Skip caching for most error responses (except 403 and 404)
  • Skip caching for pages smaller than 1KB (likely empty/error pages)
  • Added automatic drop-in regeneration after plugin updates
  • Implemented secure random filename for settings file (unguessable)
  • Improved version tracking and update detection
  • Updated tested up to WordPress 6.8

1.0.1

  • Bug fixes and improvements

1.0.0

  • First release: simple page cache with automatic e-commerce detection.