Coder Social home page Coder Social logo

htmlcache's Introduction

HTML Cache plugin for Craft CMS 3.x

Cache pages to HTML and boost website performance.

img

This plugin generates static HTML files from your dynamic Craft CMS project. After a HTML file is generated, your webserver will serve that file instead of processing heavier and slower PHP scripts.

99% of your visitors will be served static HTML files. A cached file can be served thousands of times. That 1% could be a POST request (like AJAX forms) and btw:

  • sections with a login won’t work
  • the admin panel is also NOT cached

Requirements

This plugin only requires Craft CMS 3 or later.

HTML Cache Overview

Creates a HTML Cached page for any non-cp GET request for the duration of one hour (configurable) or until an entry has been updated. To work in DEV-mode: use the force option in the settings.

Configuring HTML Cache

If the plugin is enabled it works out of the box and no special cache tags are needed. If DevMode in Craft CMS is enabled, you will have to force enable the plugin by enabling the 'Force On' plugin setting. You can also exclude url path(s) from being cached.

Using HTML Cache

HTML Cache has a settings page where you can enable/disable it and flush the cache.

If the plugin works correctly you will see the cached files in storage/runtime/htmlcache/ folder. To check the performance improvement please use the browser inspector. There you will be able to see that the loading times are improved.

FAQ

Q: Are all cache files deleted when updating an entry, or only the ones with a relation?
A: Only related cache files will be deleted after an update. **Q: The installation fails and plugin does not work. **
A: Make sure that the folder storage/runtime/htmlcache is created and there are read/write permissions.

Credits

Made with ❤️ by Bolden – free to use and feedback is much appreciated!

Based – but rewritten, on the HTML Cache by CraftAPI in 2016

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.