Giter Club home page Giter Club logo

ngxpurged's Introduction

ngxpurged: purge an nginx cache

This is a small WSGI daemon to purge the contents of a particular nginx cache directory. It can be used to implement clearing of the entire cache from an HTTP request, e.g. during deployments when the deployment user doesn't have write access to the nginx cache.

Use it like this:

    location /__purgeall {
        if ($request_method != POST) {
            return 405;  # Method not implemented.
        }

        rewrite ^.* /purge/wagtail.io;

        include uwsgi_params;
        uwsgi_pass unix:/run/ngxpurged.sock;

        break;
    }

Then to purge the cache:

[by-web-3:wagtailsite] ~
{117} wagtailsite> curl -X POST https://wagtail.io/__purgeall
Purged <wagtail.io>, 5 deleted, 0 errors.

All the daemon actually does is delete all the files under a particular directory, so it could potentially be used to purge any sort of disk-based cache, or for other purposes. You may want to run it under AppArmor or a similar MAC system to ensure it doesn't accidentally delete anything it shouldn't.

Questions, comments: [email protected].

ngxpurged's People

Contributors

unixwitch avatar

Watchers

 avatar  avatar

Forkers

cloudxtreme

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.