On Tue, 24 Sep 2002, Matthew Toseland wrote:

> On Tue, Sep 24, 2002 at 02:47:58PM +0100, Matthew Toseland wrote:

> D'oh. You apparently need to clear your mozilla cache - it seems to
> cache the redirect from 8888 to 8890 permanently, in accordance with the
> standard.

You can fix that, (and need to!) by setting the No-Cache parameters on
a redirect.  Also, use temporary redirects rather then permanent.

(This also allows you to download a splitfile more then once without
flushing your cache.)

This works locally, but I havn't committed it to CVS.  Should work
better for what we're trying to do (Especially __INTERNAL__ redirects)

--Dan

Index: freenet/support/servlet/http/HttpServletResponseImpl.java
===================================================================
RCS file: 
/cvsroot/freenet/freenet/src/freenet/support/servlet/http/HttpServletResponseImpl.java,v
retrieving revision 1.3
diff -u -u -r1.3 HttpServletResponseImpl.java
--- freenet/support/servlet/http/HttpServletResponseImpl.java   16 Mar 2002 
18:37:46 -0000      1.3
+++ freenet/support/servlet/http/HttpServletResponseImpl.java   30 Sep 2002 
19:24:30 -0000
@@ -112,8 +112,13 @@
     public void sendRedirect(String location) throws IllegalStateException,
                                                      IOException {
         reset();
-        status = SC_MOVED_PERMANENTLY;
+        status = SC_MOVED_TEMPORARILY;
+
         setHeader("Location", encodeRedirectURL(location));
+        setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");    // Date in 
the past
+       setHeader("Cache-Control","no-store, no-cache, must-revalidate");  // 
HTTP/1.1
+       setHeader("Cache-Control","post-check=0, pre-check=0");
+       setHeader("Pragma","no-cache");                          // HTTP/1.0
         flushBuffer();
         // hmm...
     }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 155 bytes
Desc: not available
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20020930/1caac6e7/attachment.pgp>

Reply via email to