Giter Site home page Giter Site logo

leocolomb / wp-acorn-cache Goto Github PK

View Code? Open in Web Editor NEW
11.0 7.0 1.0 404 KB

💽 A WordPress cache manager powered by Laravel through Acorn.

License: ISC License

PHP 100.00%
wordpress wordpress-drop-in cache laravel acorn sage wordpress-object-cache wordpress-cache caching

wp-acorn-cache's Introduction

Acorn Cache for WordPress

A cache manager powered by Laravel through Acorn.

Build Status Packagist

Warning

🚧 This project is still rather experimental.
Most probably not functional out of the box and definitely not ready for production.

About

This plugin provides cache handlers for WordPress, using Acorn framework based on Laravel fondation.

  • Enables the two cache wrappers for WordPress using drop-ins.
  • Compatible with any driver supported by Laravel (including Redis, Memcached and Array).
  • Adds handy WP-CLI commands.
  • Targets modern software stacks.

Usage

  • Prepare your Composer file by adding custom paths.
    Replace <wordpress-root/wp-content/> with your WordPress content path, web/app/ with Bedrock.
    See more info.

    {
      "extra": {
        "dropin-paths": {
          "<wordpress-root/wp-content/>": [
            "package:leocolomb/wp-acorn-cache:dropins/object-cache.php",
            "package:leocolomb/wp-acorn-cache:dropins/advanced-cache.php"
          ]
        }
      }
    }
  • Require the installer and allow its usage.

    composer require koodimonni/composer-dropin-installer
  • Require the package in your Composer-managed WordPress instance.

    composer require leocolomb/wp-acorn-cache

Object Cache

The WordPress Object Cache is used to save on trips to the database. The Object Cache stores all of the cache data to memory and makes the cache contents available by using a key, which is used to name and later retrieve the cache contents.

See WordPress documentation.

Driver (recommended)

The cache driver must be setup as per Laravel documentation.

When using Bedrock as WordPress boilerplate, specify the driver in your .env file.

CACHE_DRIVER=redis

Configuration (optional)

Object cache behavior can be configured with its appropriate config file, config/object-cache.php.

Start by publishing the configuration file using Acorn.

wp acorn vendor:publish --provider="LeoColomb\WPAcornCache\Providers\AcornCacheServiceProvider"

Page Cache

With Page Caching, you cache the full output of a page (i.e. the response) and bypass WordPress entirely on subsequent requests.

Note: The page cache is using Symfony HttpCache. While quite efficient, you should prefer using an appropriate page cache tool, like Varnish, Nginx cache or a CDN.

Activation (optional)

Page cache is not activated per default with WordPress. To enable page cache, define the constant WP_CACHE to true.

Configuration (optional)

Page cache behavior can be configured with its appropriate config file, config/page-cache.php.

Start by publishing the configuration file using Acorn.

wp acorn vendor:publish --provider="LeoColomb\WPAcornCache\Providers\AcornCacheServiceProvider"

License

ISC Š LÊo Colombaro

wp-acorn-cache's People

Contributors

dependabot[bot] avatar leocolomb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

amphibee

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.