[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Bug#39711: kio-http ignores HTTP cache control commands
From:       Waldo Bastian <bastian () kde ! org>
Date:       2002-03-24 5:30:30
[Download RAW message or body]

On Saturday 23 March 2002 08:50 pm, Andrew Kohlsmith wrote:
> As you can see, it is seeing the header and even (now) acting on it, but
> the image persists; I wonder if I have to set a deleted flag...

Hmm... the images are refcounted. That means that it will not be deleted as 
long as the image is still in use (e.g. shown on the current page) and when 
you reload the page or go to a next page I guess it isn't guaranteed that the 
cache is flushed. What might work is if the code that does the cache-lookup 
could decide that the current version in the cache has expired and that it 
should request a new image.

Something like:

--- loader.cpp  2002/02/03 01:47:10     1.110
+++ loader.cpp  2002/03/24 05:25:31
@@ -1207,7 +1207,7 @@ CachedImage *Cache::requestImage( DocLoa
     CachedObject *o = 0;
     if (!reload)
         o = cache->find(kurl.url());
-    if(!o)
+    if(!o || (o->status() == CachedObject::Uncacheable))
     {
 #ifdef CACHE_DEBUG
         kdDebug( 6060 ) << "Cache: new: " << kurl.url() << endl;


If that works then we should probably use an extra state "Expired" instead of 
"Uncacheable" or use m_expireDate for this somehow, because Uncacheable
currently means "It is too big for the cache, don't keep it". But we certainly 
don't want to load it again if it still happens to be in the cache. "Expired" 
would then mean "It's cached but we should fetch a new version when we need 
one".

Ideally we should also distinguish between a normal page load and accessing 
the history, because when we go back in the history we should ignore 
"Expired". 

[ Remark for other khtml developers: the above code looks buggy, when "reload" 
is true the entry in the cache will be replaced with a new entry ignoring the 
refcount of the original entry. ]

Cheers,
Waldo
-- 
bastian@kde.org  |   SuSE Labs KDE Developer  |  bastian@suse.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic