Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Cache Tags #112

Open
nikolay opened this issue Dec 29, 2015 · 5 comments
Open

Support for Cache Tags #112

nikolay opened this issue Dec 29, 2015 · 5 comments
Assignees
Labels

Comments

@nikolay
Copy link

nikolay commented Dec 29, 2015

It would be nice to implement purging by tags (ala CloudFlare and Varnish' bans). The mechanism is explained here:

I am trying to implement this via globs, but this is not the most efficient way.

Also:

@pintsized
Copy link
Member

Hi,

Thanks for this, yeah I think this would be great. I'm working on some other purge related things at the moment, but I'll take a look at this afterwards.

Of the examples you've sent, the CloudFlare version seems the most appealing. I like everything about it, except that tags are case insensitive for some reason. I'd prefer them to be case sensitive, because I think a common pattern would be to use some kind of ID system from the origin server, which is more likely to be case sensitive than not.

James.

@nikolay
Copy link
Author

nikolay commented Dec 29, 2015

@pintsized Thanks. I agree, those are not manual tags, they should be case-sensitive as such. I think tag leading and trailing whitespace should not be significant unless escaped as %20. So, I assume, tag are URI-encoded.

I haven't written anything in Lua, but I can try to help with some guidance, and I can definitely help with testing!

@nikolay
Copy link
Author

nikolay commented Dec 30, 2015

By the way, there's another Redis-based Nginx module that does wildcard purges. Maybe you guys may combine your efforts: https://github.com/wandenberg/nginx-selective-cache-purge-module

@wandenberg ^^^

@wandenberg
Copy link

@nikolay as far as I could see there are some differences on the modules that I'm not sure if make sense to combine them. The first obvious is this one needs lua support, the other use only C.
The ledge not only store the metadata on redis, it also can store the objects there, the selective purge module, only store the metadata, the nginx cache engine still intact, it seems to be more passive them ledge in this way. @pintsized I don't know much about lua, the client you use to connect on redis is synchronous?

@pintsized
Copy link
Member

Yeah, there's not really any room for combining efforts that I can see. Ledge replaces the built in cache and proxy mechanisms of Nginx, choosing to implement all of this with Lua and Redis to provide flexibility / scriptability etc. It's not able to interact with the existing Nginx cache engine.

The Redis client (and also the HTTP client used to fetch upstream resources) uses the cosocket API provided by the lua-nginx-module. So it's synchronous, but 100% non-blocking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants