Giter Club home page Giter Club logo

upper's Introduction

The pep pill for your Craft site

Latest Stable Version Total Downloads Monthly Downloads

Upper speeds up Craft dramatically using a Cache Proxy in front of your webserver.

The Plugin adds the neccessary Cache-Control and XKEY/Surrogate-Key/Cache-Tag headers to your pages. When Entries or Sections get updated in the Control Panel it takes care of the cache invalidation.

If you need an introduction to HTTP Caching, I highly recommend this article.

Sponsor

Development happens in my free time, but also during working hours. Thanks fortrabbit.com!

If you are looking additional integrations (Cache Drivers), feel free to contribute or raise an issue.

Supported Cache Drivers

  • KeyCDN (CDN/SaaS)
  • Fastly (CDN/SaaS)
  • Cloudflare (CDN/SaaS)
  • Varnish with XKEY support (your own proxy)
  • Dummy (does nothing)

Installation

  1. Install with Composer via composer require ostark/upper from your project directory
  2. Install plugin with this command php craft install/plugin upper or in the Craft CP under Settings > Plugins
  3. A new configuration file gets generated automatically in your-project/config/upper.php.

Fastly Setup

UPPER_DRIVER=fastly
FASTLY_API_TOKEN=<REPLACE-ME>
FASTLY_SERVICE_ID=<REPLACE-ME>
FASTLY_DOMAIN=http://<REPLACE-ME>

KeyCDN Setup

UPPER_DRIVER=keycdn
KEYCDN_API_KEY=<REPLACE-ME>
KEYCDN_ZONE_URL=<REPLACE-ME>.kxcdn.com
KEYCDN_ZONE_ID=<REPLACE-ME>

Cloudflare Setup

UPPER_DRIVER=cloudflare
CLOUDFLARE_API_TOKEN=<REPLACE-ME>
CLOUDFLARE_ZONE_ID=<REPLACE-ME>
CLOUDFLARE_DOMAIN=https://<REPLACE-ME>

By default, Cloudflare's CDN does not cache HTML content. You need to create a Cache Level: Cache Everything Page Rule to enable caching for "pages".

If you don't use Cloudflare Enterprise with native Cache-Tag support, make sure to enable useLocalTags in your config/upper.php file (default), otherwise disable it.

You can generate a token in the Cloudflare dashboard. You want to create a custom token with the "Zone.Cache Purge" permission that is restricted to the DNS zone(s) you wish to clear Cloudflare's cache for.

Varnish Setup

Varnish URL supports multiple servers, separate with comma. E.g http://1.1.1.1,http://2.2.2.2

UPPER_DRIVER=varnish
VARNISH_URL=<REPLACE-ME>

Tuning

With Cache-Control headers you can disabled caching for certain templates:

{% header "Cache-Control: private, no-cache" %}

Performance results

example

Cache Tag Headers

example

Disclaimer

Even if the name of the plugin and some wordings are intentional, the author does not glorify any drug abuse. ๐Ÿป The plugin is inspired by the joshangell/Falcon.

upper's People

Contributors

ostark avatar blasvicco avatar larsboldt avatar kbergha avatar

Watchers

James Cloos avatar

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.