Re: Want to avoid 304 error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux