httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bello Martinez Sergio <ser...@televes.es>
Subject Re: [users@httpd] Want to avoid 304 error
Date Mon, 23 Jul 2007 18:58:40 GMT
Ok, thanks. So, the reason of my error was to suppose that including

   <IfModule mod_expires.c>
               ExpiresActive On
               ExpiresByType text/javascript "access plus 2 minutes"
       </IfModule>

(note that the value '2 minutes' is for testing purposes only) would 
apply this header to response even if the return code is 304. That's not 
true.
So, the solution I tell you in a previous post, thats including

   <LocationMatch "\.js$">
       Header append Cache-Control "max-age=120"
   </LocationMatch>

makes Apache to include a 'Cache-Control: max-age=120' header in that 
response. But this is not enough, because it seems that Firefox doesnt 
take into account this header if response code is 304. It set 1970 as 
new expiry date no matter the value in this header.


Joshua Slive escribió:
> On 7/23/07, Bello Martinez Sergio <serbel@televes.es> wrote:
>
>> - Headers request/response after expiry time:
>
>>
>>     HTTP/1.x 304 Not Modified
>>     Date: Mon, 23 Jul 2007 17:49:31 GMT
>>     Server: Apache/2.0.54 (Linux/SUSE)
>>     Connection: Keep-Alive
>>     Keep-Alive: timeout=15, max=98
>
> So, here's your problem. The server reports that the resource is not
> modified, but does not send a new Cache-Control: max-age or Expires
> header. The old headers are therefore kept as valid, meaning that the
> resource is not-modified, but expired.
>
> Here's a similar set of headers from apache's core handler:
> Original:
> HTTP/1.1 200 OK
> Date: Mon, 23 Jul 2007 18:11:38 GMT
> Server: Apache/2.3.0-dev (Unix)
> Last-Modified: Wed, 11 Jul 2007 08:03:12 GMT
> ETag: "9276b6-4527-4f313000"
> Accept-Ranges: bytes
> Content-Length: 17703
> Cache-Control: max-age=86400
> Expires: Tue, 24 Jul 2007 18:11:38 GMT
> Vary: Accept-Encoding
> Connection: close
> Content-Type: text/html
>
> If-Modifed-Since request:
> HTTP/1.1 304 Not Modified
> Date: Mon, 23 Jul 2007 18:11:52 GMT
> Server: Apache/2.3.0-dev (Unix)
> ETag: "9276b6-4527-4f313000"
> Expires: Tue, 24 Jul 2007 18:11:52 GMT
> Cache-Control: max-age=86400
> Vary: Accept-Encoding
>
> Note the Cache-Control and Expires headers which update the client's
> freshness info.
>
> Then the question is: why aren't these headers getting sent on your
> 304 responses. I don't know whether this is a problem with your
> application or with apache, but given that I know nothing about your
> app, I'm putting my guess there ;-)
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message