Version: 3.4.0 (using KDE 3.4.0 Level "b" , SUSE 9.3) Compiler: gcc version 3.3.5 20050117 (prerelease) (SUSE Linux) OS: Linux (i686) release 2.6.11.4-21.12-smp Konqueror is caching a file that uses HTML META tags to prevent this (Pragma; no-cache, Expires; -1). I do not have access to the server so I can't set the HTTP flags, only the HTML content. This file does not change very often and is requested via AJAX. Konq turns the AJAX GET request into a conditional GET so of course the server returns a 304 notice but that's not a particularly useful thing to give to Javascript because you can't access the cache from Javascript. I see bug 132953 that already exists and is possibly the same as my AJAX issues but I don't see 404 behaviour, just a 304 return code and no way to get the required content. Note that closing all Konq windows and opening it seems to work the first time so perhaps the file is not cached on disk, perhaps cached in RAM instead. I know that was a concept Netscape 4 had (RAM vs Disk cache). I don't know if modern browsers continue to use that concept. I see 2 things that should be done, both of which will resolve the problem. 1) Don't cache files marked as not to be cached, not even in RAM (that might mean honouring the META tags). 2) Don't add cache headers to AJAX GET requests (or catch the 304 and supply the file to the Javascript engine as if the call had succeeded).
Oh yeah, other browsers... None of Safari, Firefox or Internet Explorer return 304 codes to my AJAX code. Either they're not forcing a conditional GET or they're catching the 304 and passing the cached file to the AJAX code.
Can your reproduce this bug in kde 4.1.2 version? If yes can you provide us with testcase or a clear steps to reproduce this bug ?
I use the KDE that comes with my distro. If it wasn't impossible to upgrade just the browser I'd do that. I'm not using this pattern anymore but the code I was using looks like this: main page: <div id="sidebar_links"></div> <script type="text/javascript">fetch_static_content();</script> sidebar_links.html: <h2>Static Links</h2> <ul> <li><a href="2005/09/my-family.html">My Family</a></li> <li><a href="2005/09/my-computers.html">My Computers</a></li> <li><a href="2005/09/my-programs.html">My Programs</a></li> <li><a href="2005/09/misc-downloads.html">Misc Downloads</a></li> </ul> JS code: var ajax = new Object; function ajax_fetch(name) { var url = name+".html"; var req = false; if(window.XMLHttpRequest) { // branch for native XMLHttpRequest object try { req = new XMLHttpRequest(); } catch(e) { req = false; } } else if(window.ActiveXObject) { // branch for IE/Windows ActiveX version try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { req = false; } } } var thediv = document.getElementById(name); if (req) { req.onreadystatechange = function(){ reqchange(name); }; req.open("GET", url, true); req.send(""); var a = new Object; a.req = req; a.url = url; ajax[name] = a; thediv.innerHTML = "<p>Fetching links...</p>"; return true; } else { thediv.innerHTML = "<p>AJAX ERROR</p>"; return false; } } function reqchange(name) { var a = ajax[name]; if ( a == undefined ) return; var req = a.req; // only if req shows "loaded" if (req.readyState == 4) { var thediv = document.getElementById(name); // only if "OK" if (req.status == 200) { // success thediv.innerHTML = req.responseText } else { // error thediv.innerHTML = "<p>AJAX ERROR</p>"; } } } function fetch_static_content() { ajax_fetch("sidebar_links"); }
Message from the Bugsquad and Konqueror teams: This bug is closed as outdated, as we do not have the manpower to maintain the KDE3 version anymore. If you still can reproduce this issue with Konqueror 4.8.4 or later, please open a new report. Thank you for your understanding.