[elinks-dev] Re: elinks cache control (was no subject)

witekfl at poczta.onet.pl witekfl at poczta.onet.pl
Sun Mar 19 12:33:25 PST 2006


On Mon, Feb 06, 2006 at 02:53:48PM -0600, Stephen Stocker wrote:
>   Oops, I sent this without a subject. :(
> 
> 
>   On Fri Oct 28 13:17:51 MDT 2005 adair at gotadsl.co.uk wrote:
> 
> > Is anyone else having problems with Cache-Control: no-cache ?
> > I can't seem to get it to work correctly. I've found the fiendish
> >
> >         document.cache.ignore_cache_control [0|1] (default: 1)
> >        Ignore  Cache-Control  and Pragma server headers.  When set, the
> >        document is cached even with 'Cache-Control: no-cache'.
> >
> > setting and set it to 0 but I still can't get my forms to redisplay with
> > data reselected from the database. Apache has set everything i.e.
> >
> > <Directory /srv/www/htdocs>
> >      Header append Author "Bill Adair"
> >      Header append Expires "Thu, 01 Dec 2003 16:00:00 GMT"
> >      Header append Cache-Control "no-store, no-cache, must-revalidate"
> > </Directory>
> >
> > but no joy yet. The headers show up in the view headers option (I
> > assume this is at page level but have 'f'ed my frame to full screen)
> > but the frame is still cached. I can't even delete the cache contents
> > using 'C' or flush all caches as elinks claims the cache item is "in
> >use".
> > TIA
> > Bill
> 
>   Yes. <F10> "c" (flush all caches) has been broken since my October 28,
> 2005 CVS update. This was probably actually a somewhat earlier version, as I
> wasn't aware of the change to GIT.
> 
>   Anyway, I'm still using that version (probably the last thing in Elinks
> CVS), as anything newer has been virtually unusable on several sites,
> notably Yahoo groups.

Try this patch (in attachment).
I guess the problem is in get_validated_cache_entry.
When the cached is in use always the cached is returned.
I'm not sure if the patch is correct.

Witold Filipczyk

-------------- next part --------------
--- elinks/src/cache/cache.c	2006-01-10 20:49:01.831957000 +0100
+++ elinks.2/src/cache/cache.c	2006-03-19 21:17:40.544416750 +0100
@@ -187,16 +187,16 @@
 	 * reloading when spawning a new tab which could potentially be a big
 	 * penalty but shouldn't that be taken care of on a higher level?
 	 * --jonas */
-	if (is_object_used(cached)) {
 #if 0
+	if (is_object_used(cached)) {
+
 		/* Never use expired entries. */
 		/* Disabled because it hurts usability too much. */
 		if (cached->expire && cache_entry_has_expired(cached))
 			return NULL;
-#endif
 		return cached;
 	}
-
+#endif
 	/* A bit of a gray zone. Delete the entry if the it has the stricktest
 	 * cache mode and we don't want the most aggressive mode or we have to
 	 * remove the redirect or the entry expired. Please enlighten me.
@@ -204,7 +204,7 @@
 	if ((cached->cache_mode == CACHE_MODE_NEVER && cache_mode != CACHE_MODE_ALWAYS)
 	    || (cached->redirect && !get_opt_bool("document.cache.cache_redirects"))
 	    || (cached->expire && cache_entry_has_expired(cached))) {
-		delete_cache_entry(cached);
+		if (!is_object_used(cached)) delete_cache_entry(cached);
 		return NULL;
 	}
 


More information about the elinks-dev mailing list