PHPackages                             ostark/upper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. ostark/upper

AbandonedArchivedCraft-plugin[Caching](/categories/caching)

ostark/upper
============

A cache plugin for Craft - supporting multiple Edge Caches

1.9.2(4y ago)10337.3k20[10 issues](https://github.com/ostark/upper/issues)[7 PRs](https://github.com/ostark/upper/pulls)1MITPHP

Since Oct 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ostark/upper)[ Packagist](https://packagist.org/packages/ostark/upper)[ RSS](/packages/ostark-upper/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (3)Versions (32)Used By (1)

[![](https://github.com/ostark/upper/raw/master/resources/upper.png)](https://github.com/ostark/upper/blob/master/resources/upper.png)

The pep pill for your Craft site
================================

[](#the-pep-pill-for-your-craft-site)

[![Latest Stable Version](https://camo.githubusercontent.com/14d5405a0e0b5bd77ed5b919ee25f45e7762ecfdd6cf854e1ee93dc343bd26b4/68747470733a2f2f706f7365722e707567782e6f72672f6f737461726b2f75707065722f762f737461626c65)](https://packagist.org/packages/ostark/upper)[![Total Downloads](https://camo.githubusercontent.com/2ef31dfeaf2d9065ad6f9747ed04cf0cdc59768c06d8eff4ca07de15627da21a/68747470733a2f2f706f7365722e707567782e6f72672f6f737461726b2f75707065722f646f776e6c6f616473)](https://packagist.org/packages/ostark/upper)[![Monthly Downloads](https://camo.githubusercontent.com/82bb50e3bd63cb6fd73ba00efc16e5cf43cb6679240aed5eb45369aed1eb71c7/68747470733a2f2f706f7365722e707567782e6f72672f6f737461726b2f75707065722f642f6d6f6e74686c79)](https://packagist.org/packages/ostark/upper)

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](https://blog.fortrabbit.com/mastering-http-caching).

Sponsor
-------

[](#sponsor)

Development happens in my free time, but also during working hours. Thanks [fortrabbit.com](https://www.fortrabbit.com/craft-hosting)!

If you are looking additional integrations (Cache Drivers), feel free to contribute or [raise an issue](https://github.com/ostark/upper/issues).

Supported Cache Drivers
-----------------------

[](#supported-cache-drivers)

- [KeyCDN](https://www.keycdn.com) (CDN/SaaS)
- [Fastly](https://www.fastly.com) (CDN/SaaS)
- [Cloudflare](https://www.cloudflare.com) (CDN/SaaS)
- Varnish with XKEY support (your own proxy)
- Dummy (does nothing)

Installation
------------

[](#installation)

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

### Fastly Setup

[](#fastly-setup)

```
UPPER_DRIVER=fastly
FASTLY_API_TOKEN=
FASTLY_SERVICE_ID=
FASTLY_DOMAIN=http://

```

### KeyCDN Setup

[](#keycdn-setup)

```
UPPER_DRIVER=keycdn
KEYCDN_API_KEY=
KEYCDN_ZONE_URL=.kxcdn.com
KEYCDN_ZONE_ID=

```

### Cloudflare Setup

[](#cloudflare-setup)

```
UPPER_DRIVER=cloudflare
CLOUDFLARE_API_TOKEN=
CLOUDFLARE_ZONE_ID=
CLOUDFLARE_DOMAIN=https://

```

By default, Cloudflare's CDN does not cache HTML content. You need to create a [**Cache Level: Cache Everything**](https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-Cloudflare-What-to-Cache-) 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-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=

```

### Tuning

[](#tuning)

In a template, you can fully disable caching like so:

```
{% do upper.cache.never() %}

```

…which is a shorthand for:

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

```

By default the `defaultMaxAge` config setting will be used to determine the cache duration to set. This can be overridden in a template:

```
{% do upper.cache.for('5 minutes') %}

```

…which is shorthand for:

```
{% header "Cache-Control: public, s-maxage=300" %}

```

### Performance results

[](#performance-results)

[![example](https://github.com/ostark/upper/raw/master/resources/preformance.png)](https://github.com/ostark/upper/blob/master/resources/preformance.png)

### Cache Tag Headers

[](#cache-tag-headers)

[![example](https://github.com/ostark/upper/raw/master/resources/response-header.png)](https://github.com/ostark/upper/blob/master/resources/response-header.png)

Disclaimer
----------

[](#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](https://github.com/joshangell/Falcon).

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~64 days

Recently: every ~106 days

Total

26

Last Release

1561d ago

Major Versions

1.4.2 → 2.0.0-beta12019-01-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f2939b15a562ee53b5284f58b704e53ae26b975c1154fa6afb2f8b8331fbd27?d=identicon)[ostark](/maintainers/ostark)

---

Top Contributors

[![blasvicco](https://avatars.githubusercontent.com/u/1821068?v=4)](https://github.com/blasvicco "blasvicco (8 commits)")[![larsboldt](https://avatars.githubusercontent.com/u/201756?v=4)](https://github.com/larsboldt "larsboldt (5 commits)")[![timkelty](https://avatars.githubusercontent.com/u/18329?v=4)](https://github.com/timkelty "timkelty (5 commits)")[![kbergha](https://avatars.githubusercontent.com/u/4321846?v=4)](https://github.com/kbergha "kbergha (3 commits)")[![markhuot](https://avatars.githubusercontent.com/u/48975?v=4)](https://github.com/markhuot "markhuot (3 commits)")

---

Tags

cachecache-purgecloudflarecraft-plugincraft3craftcmsfastlykeycdncachecmscloudflareCraftcraftcmscraft-pluginfastlykeycdn

###  Code Quality

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ostark-upper/health.svg)

```
[![Health](https://phpackages.com/badges/ostark-upper/health.svg)](https://phpackages.com/packages/ostark-upper)
```

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[acclaro/translations

Easily launch and manage multilingual Craft websites without having to copy/paste content or manually track updates.

1329.6k](/packages/acclaro-translations)[mmikkel/cache-flag

Cold template caches that can be flagged and automatically invalidated.

1730.4k1](/packages/mmikkel-cache-flag)[verbb/events

A full-featured plugin for event management and ticketing.

2311.9k](/packages/verbb-events)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
