WireCache Filesystem cache handler for ProcessWire 3.0.218+

ProcessWire WireCache module that replaces the default cache handler with a file system based cache.

WireCache Filesystem

ProcessWire WireCache module that replaces the default cache handler with a file system based cache.

This module requires ProcessWire 3.0.218 or newer. Do not attempt to install it on prior versions as the necessary interfaces do not exist prior to 3.0.218.

To use this module, you don't need to do anything other than install it. Once installed, it takes over the cache storage for the $cache API variable, moving it to the file system. When you uninstall the module, cache storage moves back to the database.

Depending on the environment, the file system based cache may be potentially faster than the database cache in some instances (such as reads), or slower in others (such as writes).

This module stores cache files in the following directory: /site/assets/cache/WireCache/

This module is also meant as an example implementation of the WireCacheInterface for other modules. The core /wire/core/WireCacheDatabase.php is also a good one to look at since a lot of the code in this Filesystem module ends up being file-system related, and WireCacheDatabase may be a little simpler in communicating some parts.

Installation

  • Copy the module files into /site/modules/WireCacheFilesystem/
  • In your admin, go to Modules > Refresh.
  • Click "install" for this module.
  • That's it.

Getting and saving caches

Please see the $cache API variable for details on getting and saving caches.

Clearing the cache

It is okay to delete the /site/assets/cache/WireCache/ directory as this module will re-create it automatically. Other than that, you can also always use the $cache->deleteAll() core API method to clear the cache.


Copyright 2023 by Ryan Cramer Design, LLC / ProcessWire

More modules by Ryan Cramer

  • Hanna Code

    Easily insert any complex HTML, Javascript or PHP output in your ProcessWire content by creating your own Hanna code tags.
  • Form Builder PRO

    Building front-end forms on your website has never been so simple. ProcessWire Form Builder lets you create, edit and publish forms with no development necessary.
  • ProCache PRO

    ProCache provides the ultimate performance for your website by completely bypassing PHP and MySQL and enabling your web server to deliver pages of your ProcessWire site as if they were static HTML…
  • ProcessWire Upgrade

    Tool that helps you identify and install core and module upgrades.
  • Map Marker (Google Maps)

    This Fieldtype for ProcessWire 2.1+ holds an address or location name, and automatically geocodes the address to latitude/longitude using Google Maps API.
  • Site Profile Exporter

    Enables exporting of ProcessWire site profiles for sharing or distribution with others.
  • Video embed for YouTube/Vimeo

    Enables translation of YouTube or Vimeo URLs to full embed codes, resulting in a viewable video in textarea fields you apply it to. Now with support for responsive videos too.
  • Import Pages from CSV files

    Enables you to import CSV files to create pages.
  • Database Backups

    Create and/or restore database backups from the ProcessWire admin.

All modules by Ryan Cramer

Install and use modules at your own risk. Always have a site and database backup before installing new modules.