This Craft plugin will generate static HTML files for your website. No need for Reddis/Varnish setups anymore!
- Improves the speed drastically: 300-1500MS to 2-50MS (depending on server setup) if ubercache is enabled from the settings page
- Busts the cache automatically when an entry has been updated
- Cache duration time can be set; defaults to 3600 seconds (1 hour)
- Active development and support through Craft's Slack
- Make sure to check out the Roadmap (further below) and add your wishes/requirements through an issue
This plugin is still in beta, so please test if this plugin works as expected on a development environment before pushing to a production site.
Brought to you by CraftAPI
I've decided to keep this project Open Source/Beerware and to not publish it as a "premium" plugin. If you like the project/find it usefull and you have a few bucks to spare, you're welcome to donate a beer 🍺 through Pledgie!
To install HTML Cache, follow these steps:
- Download & unzip the file and place the
htmlcache-master
directory into yourcraft/plugins
directory - -OR- do a
git clone https://github.com/craftapi/htmlcache.git
directly into yourcraft/plugins
folder. You can then update it withgit pull
- Install plugin in the Craft Control Panel under Settings > Plugins
- The plugin folder should be named
htmlcache
for Craft to see it. GitHub recently started appending-master
(the branch name) to the name of the folder for zip file downloads.
HTML Cache works on Craft 2.5.x and Craft 2.6.x, both PHP 5.6 and 7.0
Creates a HTML Cached page for any non-cp GET request for the duration of one hour (configurable) or untill an entry has been updated. Will not serve a cached request when in DEV-mode
After installing HTML Cache, you'll be redirected to the settings page.
HTML Cache has a settings page where you can enable/disable both normal and ubercache. The ubercache alters the public/index.php file to include extra functionality before Craft gets initialised, eliminating the TTFB caused by Yii.
- Fix cached CSRF-requests
- CP Widget with amount of cache files and size, plus a button to purge the cache directly
- Move files inside _cached directory to storage/runtime directory as those permissions should work at all times
- Cache bust by webhook
- 1.1: Improve cache busting by checking the impact of an updated entry; do we really need to bust everything?
- Bugfix
- Moved a few functions to a standalone file
- Plugin settings including cache duration
- When enabling the UberCache, the public/index.php file will be altered to include the standalone file
- This improves the speed from 300-1500ms to about 2-25ms, depending on your server ;)
- Fixed case-sensitivity bug in HtmlcachePlugin.php and the Htmlcache_HtmlcacheService.php, causing an (in)visible error that did not enable the plugin
- Fixed case-sensitivity bug in HTMLCachePlugin.php, causing an invisible error that did not enable the plugin
- Moved to services instead of plugin file self
- Initial release