Re: Avoiding conditional requests

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

 



Why is the client sending "HTTP/1.0"?  MSIE 6.0 and modern browsers
should be sending "HTTP/1.1".

Why does the response contain the Header "Pragma: no-cache"?  That
implies something is telling the client that the graphic should not
depend on the cache.  The JSP is probably setting the no-cache for the
page (as an HTTP Header or an HTML Head META HTTP-EQUIV command) and
the child requests inherit the setting.

!!! Test with a static no-querystring URL:
   http://qcxp2/mytestpage.html

FILE testpage.html:
<HTML><BODY><IMG SRC="/Eip/Static/Images/Logos/siteLogo.gif"></BODY></HTML>

I rewrote the cache functions for Lenya to bypass caching when a
querystring exists because a querystring may completely change the
response:
   /homepage
   /homepage?ShowTheLoginScreen
Some software noticing the presence of the querystring may set "no-cache".

solprovider


On 10/24/07, uri_shaked@xxxxxxxxxxxxxxxxx <uri_shaked@xxxxxxxxxxxxxxxxx> wrote:
> That was the first place I turned to as well, but the browser is actually set to the default setting - "Automatically".
> another reason i think this is not a browser issue is the fact that I've also tested this on firefox and on ie7 - both set to default cache settings and the latter being on a fresh  xp installation VM machine.
> In all cased I'm seeing these recurring conditional requests.
> I guess I wanted to verify that the response code apache is returning looks as is should - the kind that should actually achieve the purpose i talked about.
>
> Uri.
>
>  solprovider@xxxxxxxxxx  24/10/2007 14:06
>
> 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@xxxxxxxxxxxxxxxxx <uri_shaked@xxxxxxxxxxxxxxxxx> 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@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