Programmatic access to Nginx fcgi/proxy cache?


nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

On 12 Jan 2012 15h15 WET, [email protected] wrote:

You can process the cache files. They’re regular files.

Here’s a script to inspect the cache:

another for purging:

There’s also a 3rd party module for cache purging. AFAIK doesn’t
support wildcards:

Just make a HTTP request from your app.

— appa

Hi,

There’s also a 3rd party module for cache purging. AFAIK doesn’t
support wildcards:

GitHub - FRiCKLE/ngx_cache_purge: nginx module which adds ability to purge content from FastCGI, proxy, SCGI and uWSGI caches.

It doesn’t, but because of that it’s the only one of those mentioned
that
works at scale.

Best regards,
Piotr S. < [email protected] >

On Jan 13, 2012, at 8:57 AM, Martin Loy wrote:

Module ngx_http_memcached_module

the memc module is better for this, at least in my experience:

HTTP Redis | NGINX

only does gets. redis2 module supports most redis commands:

I had issues in the past with the app writing into the cache and nginx
reading from it. Partially because of the numerous apps we run nginx in
front of. I like nginx doing the reading and the writing.

this has worked well: http://wiki.nginx.org/NginxHttpSRCacheModule
Or some simple lua using location captures.

if you used redis, for example, you could do something in lua to do the
purging that took regexes fairly easily.

–Brian

Ben

Why not use memcached/redis/etc as cache backend instead of file based
cache, nginx works with them great and you just need to populate the
cache
at application level :slight_smile:

http://wiki.nginx.org/HttpMemcachedModule

Regards

M