Closed (fixed)
Project:
Barracuda
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2011 at 20:04 UTC
Updated:
4 Jan 2012 at 16:40 UTC
I'm testing integration with purge (#1048000: nginx support) and I have it running, but I was wondering how to clear the cache of all devices, I tried adding multiple fastcgi_cache_purge inside the location directive, but it's a no go :/
Comments
Comment #1
omega8cc commentedJust
rm -f -r /var/lib/nginx/speed/*clears all Nginx caches.Comment #2
attiks commentedI know that, the goal is to use expire and purge to do it in a controlled way, it's a bit expensive to clear all caches on every page edit.
nginx_advanced_include.conf:
It would be nice if we could do the following inside nginx_speed_purge.conf:
Comment #3
omega8cc commentedAh, right, it no longer works after we introduced $device in the cache key. It is a bug then.
I didn't test it yet, but we probably can't use multiple
fastcgi_cache_purgein the same location?Comment #4
attiks commentedNo, you can't :/
Related is the use of the cookie in the cache key, so I opened 2 issues:
Comment #5
omega8cc commentedSo we should at least add 'normal' there to support non-mobile cache entries purging:
Comment #6
attiks commentedthat's what i did and it works, but i'm still struggling with the clearing of the cache for non anon users, I googled a bit but since the filename is md5 of the URI i think this will be a problem.
Comment #7
omega8cc commentedI don't think it will be possible, as this md5 hash is stored only in the cache itself. Anyway, cache for logged in users is valid only for 5 minutes by default and skipped entirely after any POST request.
Comment #8
attiks commentedI created a feature request on the nginx forms to add fainer grained control on the cache filenames: http://forum.nginx.org/read.php?10,217748
Comment #9
omega8cc commentedThanks. Let's see what they can do to support our crazy setup ;)
Comment #10
attiks commentedi think we need 4 purge methods, one for each device. the purge module support multiple servers, so should work?
location ~ /purgenormal(/.*) {
fastcgi_cache_purge speed normal$host$1$is_args$args;
}
Comment #11
omega8cc commentedNot sure how it is expected to fix the problem.
We force by default
$conf['purge_proxy_urls'] = "http://127.0.0.1:8888/purge?purge_method=get";and even if we will create separate locations (or even servers), how to make it to fire them all (for all devices) at once?We probably need to fork the purge module to make that happen.
Comment #12
attiks commentedi didn't try it yet, just thinking out loud, but i think purge uses all defined servers, but i'll try it tomorrow.
Comment #13
omega8cc commentedLet's see if this fixed the problem: http://drupalcode.org/project/barracuda.git/commitdiff/b4c6544
Comment #14
omega8cc commentedIt seems it works as expected:
Comment #15
omega8cc commented