Update/Delete cache entry

Hi guys,

I have an entry cache with nginx :

head -n10 /tmp/nginx/f/a78359efac162eed0807e0d85761441f
8?O��������(1O]� �D�
KEY: http://www.bbc.co.uk/
HTTP/1.1 200 OK
Server: Apache
Vary:
X-Country,Accept-Encoding,X-Ip_is_advertise_combined,X-Ip_is_uk_combined,
X-GeoIP
X-Cache-Action: PASS (non-cacheable)
Cache-Control: private, max-age=60
X-Cache-Age: 0
Content-Type: text/html
Content-Encoding: gzip

I’d like update this entry before expired time of cache, so I will bash
a script to delete the entry file match the URL.
I read that the cache file name is generated from md5sum of URL.
But when I use command :

echo “http://www.bbc.co.uk/” | md5sum
5dc8a729e141d2e783c2c7e710e42fa8

The result does not match the filename cached ?!
Is there any relation from file name and linux command md5sum ?

and is there another way to update/delete an entry of cache ?

Thank you.
Brs
[email protected]

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,221355,221355#msg-221355

On Tue, Jan 17, 2012 at 04:13:44AM -0500, atrus wrote:

Hi there,

Half an answer:

I have an entry cache with nginx :

head -n10 /tmp/nginx/f/a78359efac162eed0807e0d85761441f

I read that the cache file name is generated from md5sum of URL.
But when I use command :

echo “http://www.bbc.co.uk/” | md5sum
5dc8a729e141d2e783c2c7e710e42fa8

The result does not match the filename cached ?!

“echo x” generates “x newline”.

Use “echo -n x”, or (better) “printf %s x”

Is there any relation from file name and linux command md5sum ?

Yes, but you must use exactly the url.

f

Francis D. [email protected]

On 17 Jan 2012 09h13 WET, [email protected] wrote:

Hi guys,

I have an entry cache with nginx :

AFAIK there are two ways to purge the Nginx cache.

  1. Using grep throughout the cache directories to find and then
    remove the file.

  2. Using an HTTP “method” PURGE.

For the first this might be helpful:
https://github.com/perusio/nginx-cache-purge

and for the later use this:
https://github.com/FRiCKLE/ngx_cache_purge

— appa

Thanks guys.
I’ll have a try and result later.

Brs.
[email protected]

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,221355,221365#msg-221365

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs