To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.publishOpen lugnet.publish in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Publishing / 3529
     
   
Subject: 
Re: Brickshelf suggestions (was: problems?)
Newsgroups: 
lugnet.publish
Date: 
Fri, 28 Jun 2002 15:37:19 GMT
Viewed: 
2618 times
  

In lugnet.publish, Dan Boger writes:

unless there's an explicit header saying the cgi has expired

Yes.

A GET CGI is supposed to give the same output when it's
parameters are the same, so browsers are supposed to cache it's output:

from rfc 2068:

  In particular, the convention has been established that the GET and
  HEAD methods should never have the significance of taking an action
  other than retrieval. These methods should be considered "safe." This
  allows user agents to represent other methods, such as POST, PUT and
  DELETE, in a special way, so that the user is made aware of the fact
  that a possibly unsafe action is being requested.

Where does it say that a GET request always returns the same content?
a GET for a dynamic page is no different than a GET for a "static" page
that might change at some point.  Where the Expires header is set it should
always be obeyed.  Now, I am setting "Expires: 0" instead of a properly
formatted date string, so Mozilla may be ignoring it, where IE and NS
know what that means.

and

  Methods may also have the property of "idempotence" in that (aside
  from error or expiration issues) the side-effects of N > 0 identical
  requests is the same as for a single request. The methods GET, HEAD,
  PUT and DELETE share this property.

not saying that this is strictly followed, but this is how it's supposed
to work :)

Dan

   
         
   
Subject: 
Re: Brickshelf suggestions (was: problems?)
Newsgroups: 
lugnet.publish
Date: 
Fri, 28 Jun 2002 16:15:13 GMT
Viewed: 
3179 times
  

In lugnet.publish, Kevin Loch writes:
In lugnet.publish, Dan Boger writes:

unless there's an explicit header saying the cgi has expired

Yes.

wait - am I completely confused here?  I thought we wanted the cgi output to
NOT expire?  so that "back" will show you the same page?

Where does it say that a GET request always returns the same content?
a GET for a dynamic page is no different than a GET for a "static" page
that might change at some point.  Where the Expires header is set it should
always be obeyed.  Now, I am setting "Expires: 0" instead of a properly
formatted date string, so Mozilla may be ignoring it, where IE and NS
know what that means.

hmmm... :

13.9 Side Effects of GET and HEAD

   Unless the origin server explicitly prohibits the caching of their
   responses, the application of GET and HEAD methods to any resources
   SHOULD NOT have side effects that would lead to erroneous behavior if
   these responses are taken from a cache. They may still have side
   effects, but a cache is not required to consider such side effects in
   its caching decisions. Caches are always expected to observe an
   origin server's explicit restrictions on caching.

   We note one exception to this rule: since some applications have
   traditionally used GETs and HEADs with query URLs (those containing a
   "?" in the rel_path part) to perform operations with significant side
   effects, caches MUST NOT treat responses to such URLs as fresh unless
   the server provides an explicit expiration time. This specifically
   means that responses from HTTP/1.0 servers for such URIs should not
   be taken from a cache. See section 9.1.1 for related information.

it does say that "GET" should be ok to be used from the cache, but gives the
exception that if it has a "?" in it, it will not be cached unless the
server specifically ask for caching.

so I guess you're right - in general, GET cgis should not be cached.  in
this case, though, we do want it cahced, so you should set an expiration
header in the future - something like "+1d" or something.  doesn't a "0"
mean the content has expired Jan 1, 1970?

Dan

 

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR