httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: svn commit: r1070179 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/mod_cache.xml modules/cache/cache_storage.c modules/cache/cache_storage.h modules/cache/mod_cache.c modules/cache/mod_cache.h
Date Wed, 30 Nov 2011 11:30:43 GMT
On 23 Nov 2011, at 1:15 PM, Graham Leggett wrote:

> In order to make invalidation possible, we would need to add an invalidate() function
to the mod_cache provider, and keep AP_CACHE_INVALIDATE inside ap_cache_status_e. Invalidation
involves marking the entry as invalidated and "to be freshened on next hit", as opposed to
deleted.
> 
> What I could do is back out the change, and make just the above API changes, allowing
us to backport this to v2.4 when we are ready.
> 
> This releases v2.4 to get on with it, and keeps the option open for us to fix this properly
at a future date in the v2.4 cycle when we're ready.

The change has been reverted on v2.4, and the following patch gives the API changes that allow
us to fix this in the v2.4 series:

Index: modules/cache/mod_cache.h
===================================================================
--- modules/cache/mod_cache.h	(revision 1208384)
+++ modules/cache/mod_cache.h	(working copy)
@@ -109,17 +109,20 @@
                            const char *urlkey);
     int (*remove_url) (cache_handle_t *h, request_rec *r);
     apr_status_t (*commit_entity)(cache_handle_t *h, request_rec *r);
+    apr_status_t (*invalidate_entity)(cache_handle_t *h, request_rec *r);
 } cache_provider;
 
 typedef enum {
     AP_CACHE_HIT,
     AP_CACHE_REVALIDATE,
-    AP_CACHE_MISS
+    AP_CACHE_MISS,
+    AP_CACHE_INVALIDATE
 } ap_cache_status_e;
 
 #define AP_CACHE_HIT_ENV "cache-hit"
 #define AP_CACHE_REVALIDATE_ENV "cache-revalidate"
 #define AP_CACHE_MISS_ENV "cache-miss"
+#define AP_CACHE_INVALIDATE_ENV "cache-invalidate"
 #define AP_CACHE_STATUS_ENV "cache-status"
 
 
Index: modules/cache/mod_cache_disk.c
===================================================================
--- modules/cache/mod_cache_disk.c	(revision 1208379)
+++ modules/cache/mod_cache_disk.c	(working copy)
@@ -1325,6 +1325,11 @@
     return APR_SUCCESS;
 }
 
+static apr_status_t invalidate_entity(cache_handle_t *h, request_rec *r)
+{
+    return APR_ENOTIMPL;
+}
+
 static void *create_dir_config(apr_pool_t *p, char *dummy)
 {
     disk_cache_dir_conf *dconf = apr_pcalloc(p, sizeof(disk_cache_dir_conf));
@@ -1502,7 +1507,8 @@
     &create_entity,
     &open_entity,
     &remove_url,
-    &commit_entity
+    &commit_entity,
+    &invalidate_entity
 };
 
 static void disk_cache_register_hook(apr_pool_t *p)

Regards,
Graham
--


Mime
View raw message