httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Parin Shah" <>
Subject mod-cache-requester source code
Date Fri, 24 Feb 2006 08:45:27 GMT

My svn account is created now, and I have commited mod-cache-requester files.

Along with these files, I had to make some changes in mod_cache.c,
mod_cache.h and config.m4 as well. I am attaching patches for all
three files with this mail.

in mod_cache.h I have added declaration of  cache_requester data structure.

+#define CACHE_REQUESTER_PROVIDER_GROUP "cache_requester"

+typedef struct {
+    int (*notify_cache_requester) (request_rec *r, cache_handle_t *handle);
+} cache_req_provider;

- in mod_cache.c I have added code for calling mod_cache_requester if
the page is 'soon-to-expire'

+    cache_req_provider *cache_requester;
+    char *is_from_cache_requester;
+    cache_handle_t *handle;

+    cache_requester = (cache_req_provider *)
ap_lookup_provider(CACHE_REQUESTER_PROVIDER_GROUP, "cache_req", "0");
+    if(cache_requester != NULL) {
+        if( cache_requester->notify_cache_requester(r, cache->handle)
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r->server,
+                         "Adding CACHE_SAVE filter.");
+            ap_add_output_filter_handle(cache_save_filter_handle, NULL, r,
+                                        r->connection);
+            return DECLINED;
+        }
+    }

- config.m4 of mod_cache required modification to add mod_cache_requester.

Please have a look at the code availabe in repository and patches
attached with this mail and let me know your thoughts. all your
suggestions/corrections are welcome!

Currently, mod-cache-requester has dependency on libcurl. basically,
mod-cache-requester has to make a request for a page to refresh cache,
and it seems there is no straight forward way to do so if you dont
have connection available. thats why we had to use libcurl instead.

so as a next step, I am planning to investigate more about how to get
rid of libcurl from the code. any pointers in that direction would be
really helpful.


View raw message