I noticed that hook_expire_cache passes along links like http://example.com/. I can imagine some intended use for this but I would have to filter it out in my use case.
I noticed this while writing the purge module (in cvs application queue still: #938548: SqyD [sqyd]) that implements hook_expire_cache to clear the urls from varnish (or squid) caches over http. The varnish module also seems to trigger errors in Varnish logs.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | expire-968366.patch | 1.15 KB | mikeytown2 |
Comments
Comment #1
mikeytown2 commentedI pass along a fully qualified URL as that has all the info one needs; if I pass along less info then something might be missing. I see that you are already using parse_url() in your code. This is the correct way to extract what you need.
Another reason I pass full URL's is so an external crawler can be used for expiration (hit the url to refresh the cache) instead of a hard flush like varnish does. At work we use boost because of the boost_cache database table. It works with views and panels. We have a crawler (not written in php) that checks for urls that need to be re-crawled every 30 seconds. By going this route we almost always have every page in our varnish cache & we support a cache lifetime of 10 days.
I'm keeping the Cache Expiration module very light but I plan on supporting more cache expiration features from boost once I get the performance and memory usage under control when using views and panels expiration. To see what I'm talking about give the latest dev version of boost a try; I find it works very well in terms of detecting what pages a node shows up on (node create/update) or used to show up on (node deletion).
EDIT:
helps to read the title.
<front>shouldn't be passed along; it should be the actual URL.Comment #2
mikeytown2 commentedComment #3
SqyD commentedSorry, I just noted the front tag was stripped by the input filter. Should have said:
I noticed that hook_expire_cache passes along links like
http://example.com/<front>Comment #4
mikeytown2 commentedComment #6
SqyD commentedThat looks very good to me (and much better then the dirty fix I had in place). I'm without a decent test env at the moment but will give it a spin soon.
I've also taken a look at boost and it's "expire" stuff and like it a lot. The views (and in a lesser degree panels) integration will make expire much more useful. Is it possible to hook into the boost "expire" routines in a similar manner as expire module? It would be nice to hook into boost directly from purge
Your setup sounds interesting... I've been thinking to implement immediate refetching after purge at the varnish vcl level to make sure it's in cache after a refresh. That would do it except the prepopulating a crawler setup can provide.
Thanx!
Comment #7
mikeytown2 commentedcommitted