httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solprovi...@apache.org
Subject Re: [users@httpd] Avoiding conditional requests
Date Wed, 24 Oct 2007 12:06:27 GMT
Check your browser settings:

Internet Explorer 6.0 - Tools - Internet Options - General - Temporary
Internet Files - Settings - Check for newer versions of stored pages:
__ Every visit to the page
__ Every time you start Internet Explorer
__ Automatically
__ Never

Mozilla 1.7.3 - Edit - Preferences - Advanced - Cache - Compare the
page in the cache to the page on the network:
__ Every time I view the page
__ When the page is out of date
__ Once per session
__ Never

The server-specified expiration period should only affect MSIE's
"Automatically" and Mozilla's "When the page is out of date" options.
As a web developer, you are very likely to have set your browser to
the top most-frequently-updated setting to force the appearance of
changes from your current work (and may still sometimes need to
manually clear the cache.)  The "every time" settings will send the
conditional request for every request while ignoring expiration
datetimes.

You can see the Expires header so you know the server is configured as
you desire.  Your browser must be configured to use the setting to
prove your browser works as desired.

solprovider


On 10/24/07, uri_shaked@magicsoftware.com <uri_shaked@magicsoftware.com> wrote:
> I've been trying to improve my webapp's performance by telling Apache
> [2.2.4] to force clients to cache static content using mod_expires.
> I'm basically trying to avoid having the client browser resend the
> 'if-modified' conditional request for the static content upon a refresh or a
> revisit to the site, thus saving the round-trip time and having the page
> presented straight from cache . For this, I've added the following lines to
> my httpd.conf:
>
> LoadModule expires_module modules/mod_expires.so
> ExpiresActive on
> ExpiresDefault "access plus 2 hours"
> ExpiresByType image/gif "access plus 7 days"
> ExpiresByType image/jpeg "access plus 7 days"
> ExpiresByType text/css "access plus 7 days"
> ExpiresByType application/x-javascript "access plus 12 hours"
>
> The problem is that for some reason this doesn't seem to work, and the
> browser [ie6] still sends the conditional requests, disregarding the
> expiration directive.
> here is an example HTTP traffic caputre (using Fiddler):
>
> First Request
>
> GET /Eip/Static/Images/Logos/siteLogo.gif HTTP/1.0
> Accept: */*
> Referer: http://qcxp2/Eip/bin/ibp.jsp?ibpPage=HomePage&
> Accept-Language: he
> Proxy-Connection: Keep-Alive
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
> InfoPath.1; FDM; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
> Host: qcxp2
> Cookie: JSESSIONID=4662B8AA7EC6B9AE09258672CBDCE54C
>
> First Response
>
> HTTP/1.1 200 OK
> Date: Wed, 24 Oct 2007 08:37:29 GMT
> Server: Apache/2.2.4 (Win32) mod_jk/1.2.25
> Last-Modified: Mon, 17 Sep 2007 09:00:24 GMT
> ETag: "8e5a-782-8f6da00"
> Accept-Ranges: bytes
> Content-Length: 1922
> Cache-Control: max-age=604800
> Expires: Wed, 31 Oct 2007 08:37:29 GMT
> Connection: close
> Content-Type: image/gif
>
> GIF89a]
>
> Second Request (the one that souldn't actually occur at all)
>
> GET /Eip/Static/Images/Logos/siteLogo.gif HTTP/1.0
> Accept: */*
> Referer: http://qcxp2/Eip/bin/ibp.jsp?ibpPage=HomePage&
> Accept-Language: he
> Proxy-Connection: Keep-Alive
> If-Modified-Since: Mon, 17 Sep 2007 09:00:24 GMT
> If-None-Match: "8e5a-782-8f6da00"
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
> InfoPath.1; FDM; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
> Host: qcxp2
> Pragma: no-cache
> Cookie: JSESSIONID=4662B8AA7EC6B9AE09258672CBDCE54C
>
> Second Response
>
> HTTP/1.1 304 Not Modified
> Date: Wed, 24 Oct 2007 08:41:12 GMT
> Server: Apache/2.2.4 (Win32) mod_jk/1.2.25
> Connection: close
> ETag: "8e5a-782-8f6da00"
> Expires: Wed, 31 Oct 2007 08:41:12 GMT
> Cache-Control: max-age=604800
>
> Any ideas?
>  Uri

---------------------------------------------------------------------
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