Bug 45149 - Provide cache purge as a normal handler usable through a configurable url
Summary: Provide cache purge as a normal handler usable through a configurable url
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_cache (show other bugs)
Version: 2.5-HEAD
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2008-06-06 04:30 UTC by rahul
Modified: 2018-02-25 20:26 UTC (History)
0 users



Attachments
A handler to provide cache purge operation (6.37 KB, text/plain)
2008-06-06 04:30 UTC, rahul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rahul 2008-06-06 04:30:31 UTC
Created attachment 22086 [details]
A handler to provide cache purge operation

A simple minded cache purge.
    1) does not understand variants.
    2) takes input as a post request with a number of URLs one per line
    3) generates our own request, so should be possible to add vary &
        headers
configuration
-------------
<Location /cache>
    SetHandler meta_cache
</Location>

invoke e.g

$cat > url.file
/index.html
http://webproxy.india.sun.com/index.html
^D

$wget --post-file url.file 'http://agneyam.india.sun.com:8080/cache?purge'
Comment 1 Nick Kew 2008-06-08 11:02:52 UTC
Thanks for the patch, but aren't you doing rather too much work here?

(1) Why wouldn't a normal subrequest serve for your fake_request?
(2) How about mod_request vs your process_post?  Hmmm, OK, I think that's a limitation of mod_request rather than of your patch.

More importantly, you're touching private parts of mod_cache.  That's liable to break at any time.  If you can't get what you need from the public API, that's a subject that should be raised on the dev@ list.  As it stands, it's something between a patch and a module.

Also more fundamental: what protocols does your module implement?  I'm not sure what web caching protocols are relevant in the real world (e.g. compatibility with squid would be a plus), but folks on dev@ might know better.
Comment 2 Graham Leggett 2010-09-27 17:30:47 UTC
From what I can see, I don't see what PURGE does that isn't already done by a
GET with a "Cache-Control: no-cache" header (to refresh) or "no-store" header
(to purge) in the request?

I suspect what is being attempted here is already offered out the box by
RFC2616.
Comment 3 Graham Leggett 2010-10-18 19:15:48 UTC
htcacheclean in httpd-trunk includes the capability to purge cache entries from the command line:

htcacheclean -p /path/to/my/cache http://delete.me/?

Resolving as fixed for now, as we have means to purge entries in the cache via RFC2616, and (in trunk) via the command line.
Comment 4 Rainer Jung 2018-02-25 20:26:28 UTC
Undo spam change