{"id":13473698,"url":"https://github.com/ostark/upper","last_synced_at":"2025-03-26T19:34:35.731Z","repository":{"id":26346119,"uuid":"107682727","full_name":"ostark/upper","owner":"ostark","description":"Integrates Edge Caches like Fastly, KeyCDN, Cloudflare and Varnish with Craft.","archived":true,"fork":false,"pushed_at":"2024-02-16T08:19:20.000Z","size":576,"stargazers_count":102,"open_issues_count":17,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-12T05:02:51.789Z","etag":null,"topics":["cache","cache-purge","cloudflare","craft-plugin","craft3","craftcms","fastly","keycdn"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ostark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-20T13:41:16.000Z","updated_at":"2024-04-19T16:26:13.000Z","dependencies_parsed_at":"2024-01-02T23:04:24.179Z","dependency_job_id":"e46bd8f8-dd25-464f-b9d7-0e692eae97ae","html_url":"https://github.com/ostark/upper","commit_stats":{"total_commits":98,"total_committers":9,"mean_commits":10.88888888888889,"dds":0.326530612244898,"last_synced_commit":"96751f6e72f1d3dcd4f499dcbf6bf447b6000363"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostark%2Fupper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostark%2Fupper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostark%2Fupper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostark%2Fupper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ostark","download_url":"https://codeload.github.com/ostark/upper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245722898,"owners_count":20661847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","cache-purge","cloudflare","craft-plugin","craft3","craftcms","fastly","keycdn"],"created_at":"2024-07-31T16:01:06.090Z","updated_at":"2025-03-26T19:34:34.414Z","avatar_url":"https://github.com/ostark.png","language":"PHP","funding_links":[],"categories":["DNS"],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/ostark/upper/blob/master/resources/upper.png\" height=\"80px\"/\u003e\n\n\n# The pep pill for your Craft site\n\n[![Latest Stable Version](https://poser.pugx.org/ostark/upper/v/stable)](https://packagist.org/packages/ostark/upper)\n[![Total Downloads](https://poser.pugx.org/ostark/upper/downloads)](https://packagist.org/packages/ostark/upper)\n[![Monthly Downloads](https://poser.pugx.org/ostark/upper/d/monthly)](https://packagist.org/packages/ostark/upper)\n\n\n\nUpper speeds up Craft dramatically using a **Cache Proxy** in front of your webserver. \n\nThe Plugin adds the neccessary `Cache-Control` and `XKEY/Surrogate-Key/Cache-Tag` headers to your pages. \nWhen Entries or Sections get updated in the Control Panel it takes care of the cache invalidation. \n\nIf you need an introduction to HTTP Caching, I highly recommend [this article](https://blog.fortrabbit.com/mastering-http-caching). \n\n## Sponsor\n\nDevelopment happens in my free time, but also during working hours. \nThanks [fortrabbit.com](https://www.fortrabbit.com/craft-hosting)!\n\nIf you are looking additional integrations (Cache Drivers), feel free to contribute or [raise an issue](https://github.com/ostark/upper/issues).\n\n## Supported Cache Drivers\n\n* [KeyCDN](https://www.keycdn.com) (CDN/SaaS)\n* [Fastly](https://www.fastly.com) (CDN/SaaS)\n* [Cloudflare](https://www.cloudflare.com) (CDN/SaaS)\n* Varnish with XKEY support (your own proxy)\n* Dummy (does nothing)\n\n## Installation\n\n1. Install with Composer via `composer require ostark/upper` from your project directory\n2. Install plugin with this command `php craft plugin/install upper` or in the Craft CP under Settings \u003e Plugins\n3. A new configuration file gets generated automatically in `your-project/config/upper.php`.\n\n\n\n### Fastly Setup\n\n```\nUPPER_DRIVER=fastly\nFASTLY_API_TOKEN=\u003cREPLACE-ME\u003e\nFASTLY_SERVICE_ID=\u003cREPLACE-ME\u003e\nFASTLY_DOMAIN=http://\u003cREPLACE-ME\u003e\n```\n\n### KeyCDN Setup\n\n```\nUPPER_DRIVER=keycdn\nKEYCDN_API_KEY=\u003cREPLACE-ME\u003e\nKEYCDN_ZONE_URL=\u003cREPLACE-ME\u003e.kxcdn.com\nKEYCDN_ZONE_ID=\u003cREPLACE-ME\u003e\n```\n\n### Cloudflare Setup\n\n```\nUPPER_DRIVER=cloudflare\nCLOUDFLARE_API_TOKEN=\u003cREPLACE-ME\u003e\nCLOUDFLARE_ZONE_ID=\u003cREPLACE-ME\u003e\nCLOUDFLARE_DOMAIN=https://\u003cREPLACE-ME\u003e\n```\n\nBy 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\".\n\nIf 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.\n\nYou 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.\n\n \n### Varnish Setup\nVarnish URL supports multiple servers, separate with comma. E.g `http://1.1.1.1,http://2.2.2.2`\n```\nUPPER_DRIVER=varnish\nVARNISH_URL=\u003cREPLACE-ME\u003e\n```\n\n### Tuning\n\nIn a template, you can fully disable caching like so:\n\n```\n{% do upper.cache.never() %}\n```\n\n…which is a shorthand for:\n\n```\n{% header \"Cache-Control: private, no-cache\" %}\n```\n\nBy default the `defaultMaxAge` config setting will be used to determine the cache duration to set. This can be overridden in a template:\n\n```\n{% do upper.cache.for('5 minutes') %}\n```\n\n…which is shorthand for:\n\n```\n{% header \"Cache-Control: public, s-maxage=300\" %}\n```\n\n### Performance results\n![example](https://github.com/ostark/upper/blob/master/resources/preformance.png)\n\n### Cache Tag Headers\n![example](https://github.com/ostark/upper/blob/master/resources/response-header.png)\n\n\n## Disclaimer\n\nEven if the name of the plugin and some wordings are intentional, the author does not glorify any drug abuse. 🍻\nThe plugin is inspired by the [joshangell/Falcon](https://github.com/joshangell/Falcon).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostark%2Fupper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fostark%2Fupper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostark%2Fupper/lists"}