niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Apps » Squid
ignoring If-Modified-Since: from browsers, but still generating If-Modified-Since: requests
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
Chris Lightfoot
*nix forums addict


Joined: 22 Mar 2005
Posts: 62

PostPosted: Wed Jun 21, 2006 11:53 am    Post subject: Re: ignoring If-Modified-Since: from browsers, but still generating If-Modified-Since: requests Reply with quote

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

PostPosted: Wed Jun 21, 2006 1:32 am    Post subject: Re: ignoring If-Modified-Since: from browsers, but still generating If-Modified-Since: requests Reply with quote

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

PostPosted: Fri Jun 16, 2006 5:35 pm    Post subject: ignoring If-Modified-Since: from browsers, but still generating If-Modified-Since: requests Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Sat Jan 10, 2009 12:32 am | All times are GMT
navigation Forum index » Apps » Squid
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Printing from different browsers Godzilla Suse 0 Fri Jul 21, 2006 12:22 pm
No new posts Web browsers Mark Rae Suse 18 Thu Jul 20, 2006 12:32 pm
No new posts SQUID3: enable ssl requests between SQUID and backend ser... gwaa Squid 0 Tue Jul 18, 2006 4:52 am
No new posts Efficiently generating bits nish.sinnadurai@gmail.com C 3 Sat Jul 15, 2006 11:35 pm
No new posts generating perl code from awk Farhat Habib Perl 4 Wed Jul 12, 2006 7:14 am

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
[ Time: 0.3068s ][ Queries: 20 (0.2301s) ][ GZIP on - Debug on ]