|
|
|
|
|
|
| Author |
Message |
Chris Lightfoot *nix forums addict
Joined: 22 Mar 2005
Posts: 62
|
Posted: Wed Jun 21, 2006 11:53 am Post subject:
Re: ignoring If-Modified-Since: from browsers, but still generating If-Modified-Since: requests
|
|
|
On Wed, Jun 21, 2006 at 03:32:52AM +0200, Henrik Nordstrom wrote:
| Quote: | fre 2006-06-16 klockan 18:35 +0100 skrev Chris Lightfoot:
client. Therefore (and while we'd like to save the
bandwidth...) we need to have squid treat conditional GETs
as non-conditional; but obviously we still need to use
conditional GETs internally (otherwise we'd lose the
performance gain of using squid in the first place). Is
there a simple way to do this, or do I need to patch
squid?
You need to patch Squid unfortunately, but isn't a very hard thing to
do. Look for HDR_IF_MODIFIED_SINCE in client_side.c.
|
the patch is indeed simple -- for anyone in the same
situation, here's a patch for 2.5.9:
--- squid-2.5.9/src/client_side.c.orig 2006-06-21 12:49:20.000000000 +0100
+++ squid-2.5.9/src/client_side.c 2006-06-21 12:52:00.000000000 +0100
@@ -3104,6 +3104,12 @@
safe_free(prefix);
break;
}
+
+ /* Many modern browsers do not correctly support If-Modified-Since:
+ * conditional GETs, so suppress that header in incoming requests.
+ * See https://bugzilla.mozilla.org/show_bug.cgi?id=269303 */
+ httpHeaderDelByName(&request->header, "If-Modified-Since");
+
request->flags.accelerated = http->flags.accel;
if (!http->flags.internal) {
if (internalCheck(strBuf(request->urlpath))) {
--
``Press button for a 60-second speech from Cecil Parkinson.''
(graffito, on electric hand drier in loo) |
|
| Back to top |
|
 |
Henrik Nordstrom *nix forums Guru
Joined: 01 Feb 2005
Posts: 2377
|
Posted: Wed Jun 21, 2006 1:32 am Post subject:
Re: ignoring If-Modified-Since: from browsers, but still generating If-Modified-Since: requests
|
|
|
fre 2006-06-16 klockan 18:35 +0100 skrev Chris Lightfoot:
| Quote: | client. Therefore (and while we'd like to save the
bandwidth...) we need to have squid treat conditional GETs
as non-conditional; but obviously we still need to use
conditional GETs internally (otherwise we'd lose the
performance gain of using squid in the first place). Is
there a simple way to do this, or do I need to patch
squid?
|
You need to patch Squid unfortunately, but isn't a very hard thing to
do. Look for HDR_IF_MODIFIED_SINCE in client_side.c.
Regards
Hnerik |
|
| Back to top |
|
 |
Chris Lightfoot *nix forums addict
Joined: 22 Mar 2005
Posts: 62
|
Posted: Fri Jun 16, 2006 5:35 pm Post subject:
ignoring If-Modified-Since: from browsers, but still generating If-Modified-Since: requests
|
|
|
We have a squid cache in accelerator mode which is working
nicely. When we implemented this we also implemented
conditional GET support (with If-Modified-Since:) in
performance-critical parts of our site, so that for
certain performance-critical requests squid could do a
fast internal conditional-GET and then serve the cached
copy of a resource.
This has had the side-effect of allowing browsers to make
If-Modified-Since: requests to the accelerator, which then
passes them through and possibly returns a 304 to the
client itself, rather than just internally.
Unfortunately, it turns out that If-Modified-Since:
support is broken in Mozilla when a Vary: header is
sent[1]. Therefore, though the site now works fine for
non-conditional requests, it behaves inconsistently for
the large part of the audience who have this broken
client. Therefore (and while we'd like to save the
bandwidth...) we need to have squid treat conditional GETs
as non-conditional; but obviously we still need to use
conditional GETs internally (otherwise we'd lose the
performance gain of using squid in the first place). Is
there a simple way to do this, or do I need to patch
squid?
---
1. see https://bugzilla.mozilla.org/show_bug.cgi?id=269303
--
Don't look back. The lemmings might be gaining on you. |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Sat Jan 10, 2009 12:32 am | All times are GMT
|
|
MPAA | Watch Anime Online | Debt Consolidation | Free website & online homepage | Mortgages
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|