Giter Club home page Giter Club logo

purge.ee2_addon's Introduction

Purge

Purge is an extension for ExpressionEngine 2 that sends a purge request to the Varnish cache upon entry submission/deletion. There is also an accessory option to manually send the request.

Why?

I'd set the TTL of the objects in my Varnish cache to like a week if I could. The only problem is when I or the client needs to update the site, the changes are preferred to show up immediately. So I needed a way to automatically purge the cache whenever an entry is submitted, edited or deleted. And then Purge was born.

Installation

Add the "purge" folder inside your system/expressionengine/third_party directory, and then install the extension and accessory.

Prepare Varnish

Purge assumes your Varnish cache is accessible at $_SERVER['HTTP_HOST'] through port 80. To change these settings, edit purge/helpers/varnish_helper.php (this may be added to a Settings screen in a later update). Purge will send an EE_PURGE request to Varnish. To get Varnish reacting to this request, add this to your VCL file in vcl_recv:

if (req.request == "EE_PURGE") {
	purge("req.http.host ~ example.com && req.url ~ ^/.*$");
	error 200 "Purged";
}

The above example assumes you want to purge everything under the example.com domain. For more examples on how to purge specific objects, see this nice blog post.

For now, Purge cannot decide which parts of a site need updating and which can stay the same, nor will it probably ever unless EE provides this data. So for now, it's best to purge the entire site.

purge.ee2_addon's People

Contributors

kevincupp avatar timkelty avatar

Stargazers

 avatar

Watchers

 avatar 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.