Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

IIS does not return 304 Not Modified

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  IIS drops all active sessions  
Author Message
user1565

External


Since: Mar 29, 2004
Posts: 3



(Msg. 1) Posted: Mon Mar 29, 2004 4:12 pm
Post subject: IIS does not return 304 Not Modified
Archived from groups: microsoft>public>inetserver>iis, others (more info?)

Hi all,

Am I right in saying that IIS does not support conditional If-Modified-Since
requests when serving static content?

I have a site which has a large amount of graphical content - which changes
on an ad hoc basis - and have just made the move from Apache to IIS. Under
Apache, when you visited the site, IE would determine whether each of the
images had been modified (presumably using If-Modified-Since in the HTTP
headers) and thus fetch only those which had been updated.

Now I'm using IIS, each image gets re-served each and every time, regardless
of whether it has or hasn't changed since the user last cached it, which
slows down viewing by end users and is significantly increasing my bandwidth
usage.

Does anyone have any ideas on how I can get IIS to respond with a 304 Not
Modified when it's appropriate to do so, or is my only solution to return to
Apache?

Thanks in advance for all info.

Chris.

 >> Stay informed about: IIS does not return 304 Not Modified 
Back to top
Login to vote
user645

External


Since: Aug 23, 2003
Posts: 180



(Msg. 2) Posted: Mon Mar 29, 2004 7:13 pm
Post subject: Re: IIS does not return 304 Not Modified [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Chris Lacey" <chris.lacey DeleteThis @bigfoot.com> wrote in message
news:%23dRyfcYFEHA.3856@TK2MSFTNGP12.phx.gbl...
 > Hi all,
 >
 > Am I right in saying that IIS does not support conditional
If-Modified-Since
 > requests when serving static content?

 > Now I'm using IIS, each image gets re-served each and every time,
regardless
 > of whether it has or hasn't changed since the user last cached it, which
 > slows down viewing by end users and is significantly increasing my
bandwidth
 > usage.
 >
 > Does anyone have any ideas on how I can get IIS to respond with a 304 Not
 > Modified when it's appropriate to do so, or is my only solution to return
to
 > Apache?


It will only send that response, if the robot or the requester includes a
IF-MODIFIED-SINCE header<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: IIS does not return 304 Not Modified 
Back to top
Login to vote
user1565

External


Since: Mar 29, 2004
Posts: 3



(Msg. 3) Posted: Mon Mar 29, 2004 7:13 pm
Post subject: Re: IIS does not return 304 Not Modified [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the replies.

It appears that the server is indeed responding correctly to
If-Modified-Since now I've tried some tests with raw HTTP streams, so
apologies for confusing the issue.

My question now, then, is why is Internet Explorer choosing NOT to cache any
content from one of my sites (hence having to re-fetch each page and image
each time), but IS cacheing pages from another site on the same server?
Content Expiry has been set on neither.

Thanks in advance,

Chris.

"Egbert Nierop (MVP for IIS)" <egbert_nierop RemoveThis @nospam.com> wrote in message
news:eObo8fZFEHA.2768@tk2msftngp13.phx.gbl...
 > "Chris Lacey" <chris.lacey RemoveThis @bigfoot.com> wrote in message
 > news:%23dRyfcYFEHA.3856@TK2MSFTNGP12.phx.gbl...
  > > Hi all,
  > >
  > > Am I right in saying that IIS does not support conditional
 > If-Modified-Since
  > > requests when serving static content?
 >
  > > Now I'm using IIS, each image gets re-served each and every time,
 > regardless
  > > of whether it has or hasn't changed since the user last cached it, which
  > > slows down viewing by end users and is significantly increasing my
 > bandwidth
  > > usage.
  > >
  > > Does anyone have any ideas on how I can get IIS to respond with a 304
Not
  > > Modified when it's appropriate to do so, or is my only solution to
return
 > to
  > > Apache?
 >
 >
 > It will only send that response, if the robot or the requester includes a
 > IF-MODIFIED-SINCE header
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: IIS does not return 304 Not Modified 
Back to top
Login to vote
user645

External


Since: Aug 23, 2003
Posts: 180



(Msg. 4) Posted: Mon Mar 29, 2004 9:33 pm
Post subject: Re: IIS does not return 304 Not Modified [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Chris Lacey" <chris.lacey.TakeThisOut@bigfoot.com> wrote in message
news:e5izGyZFEHA.3180@TK2MSFTNGP12.phx.gbl...
 > Thanks for the replies.
 >
 > It appears that the server is indeed responding correctly to
 > If-Modified-Since now I've tried some tests with raw HTTP streams, so
 > apologies for confusing the issue.
 >
 > My question now, then, is why is Internet Explorer choosing NOT to cache
any
 > content from one of my sites (hence having to re-fetch each page and image
 > each time), but IS cacheing pages from another site on the same server?
 > Content Expiry has been set on neither.

Because the replied content (Response) should have a Last-Modified header.
If that header is in the response, IE will correctly check cached content...

An expiration header however, is using another mechanism. The browser uses
the date of file date of the static content + expiration (I believe this, it
does not use the current time )....

 > Thanks in advance,<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: IIS does not return 304 Not Modified 
Back to top
Login to vote
kenremove

External


Since: Aug 23, 2003
Posts: 3041



(Msg. 5) Posted: Tue Mar 30, 2004 2:06 am
Post subject: Re: IIS does not return 304 Not Modified [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

There are a couple of issues here:
a) what are the browser settings
b) what are the expiry settings for the content
c) whether the content has been cached.

For example, if the content has not been cached, then IE will always have to
download the images again.
If the content has expired, then IE will download the images again, because
the cached versions are "stale".

In IIS, there is a setting to set Expiry headers. This can be done on a
website, folder or individual file basis. Right-click on the website in the
IIS manager, and goto "HTTP Headers" tab, and see if "Enable Content
Expiration" has been enabled. Check again for the folder(s) that contain
your images.

Cheers
Ken


"Chris Lacey" <chris.lacey RemoveThis @bigfoot.com> wrote in message
news:%23dRyfcYFEHA.3856@TK2MSFTNGP12.phx.gbl...
: Hi all,
:
: Am I right in saying that IIS does not support conditional
If-Modified-Since
: requests when serving static content?
:
: I have a site which has a large amount of graphical content - which
changes
: on an ad hoc basis - and have just made the move from Apache to IIS.
Under
: Apache, when you visited the site, IE would determine whether each of the
: images had been modified (presumably using If-Modified-Since in the HTTP
: headers) and thus fetch only those which had been updated.
:
: Now I'm using IIS, each image gets re-served each and every time,
regardless
: of whether it has or hasn't changed since the user last cached it, which
: slows down viewing by end users and is significantly increasing my
bandwidth
: usage.
:
: Does anyone have any ideas on how I can get IIS to respond with a 304 Not
: Modified when it's appropriate to do so, or is my only solution to return
to
: Apache?
:
: Thanks in advance for all info.
:
: Chris.
:
:
 >> Stay informed about: IIS does not return 304 Not Modified 
Back to top
Login to vote
user1565

External


Since: Mar 29, 2004
Posts: 3



(Msg. 6) Posted: Tue Mar 30, 2004 2:06 am
Post subject: Re: IIS does not return 304 Not Modified [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Expiry has not been set on the site, because I don't want to set an
arbitrary expiry time. I simply want the server to support IE's request
with If-Modified-Since in the headers (so it serves the page if it has been
modified since; otherwise doesn't)... which is what used to happen on
Apache.

From what I can see, this should be the default behaviour on any web
server... but for some reason it ain't happening with my IIS 6.

Cheers,

Chris.


"Ken Schaefer" <kenREMOVE.DeleteThis@THISadOpenStatic.com> wrote in message
news:ukjkb6YFEHA.3424@tk2msftngp13.phx.gbl...
 > There are a couple of issues here:
 > a) what are the browser settings
 > b) what are the expiry settings for the content
 > c) whether the content has been cached.
 >
 > For example, if the content has not been cached, then IE will always have
to
 > download the images again.
 > If the content has expired, then IE will download the images again,
because
 > the cached versions are "stale".
 >
 > In IIS, there is a setting to set Expiry headers. This can be done on a
 > website, folder or individual file basis. Right-click on the website in
the
 > IIS manager, and goto "HTTP Headers" tab, and see if "Enable Content
 > Expiration" has been enabled. Check again for the folder(s) that contain
 > your images.
 >
 > Cheers
 > Ken
 >
 >
 > "Chris Lacey" <chris.lacey.DeleteThis@bigfoot.com> wrote in message
 > news:%23dRyfcYFEHA.3856@TK2MSFTNGP12.phx.gbl...
 > : Hi all,
 > :
 > : Am I right in saying that IIS does not support conditional
 > If-Modified-Since
 > : requests when serving static content?
 > :
 > : I have a site which has a large amount of graphical content - which
 > changes
 > : on an ad hoc basis - and have just made the move from Apache to IIS.
 > Under
 > : Apache, when you visited the site, IE would determine whether each of
the
 > : images had been modified (presumably using If-Modified-Since in the HTTP
 > : headers) and thus fetch only those which had been updated.
 > :
 > : Now I'm using IIS, each image gets re-served each and every time,
 > regardless
 > : of whether it has or hasn't changed since the user last cached it, which
 > : slows down viewing by end users and is significantly increasing my
 > bandwidth
 > : usage.
 > :
 > : Does anyone have any ideas on how I can get IIS to respond with a 304
Not
 > : Modified when it's appropriate to do so, or is my only solution to
return
 > to
 > : Apache?
 > :
 > : Thanks in advance for all info.
 > :
 > : Chris.
 > :
 > :
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: IIS does not return 304 Not Modified 
Back to top
Login to vote
user645

External


Since: Aug 23, 2003
Posts: 180



(Msg. 7) Posted: Tue Mar 30, 2004 3:02 pm
Post subject: Re: IIS does not return 304 Not Modified [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Chris Lacey" <chris.lacey.DeleteThis@bigfoot.com> wrote in message
news:%23J$xOiZFEHA.2052@TK2MSFTNGP11.phx.gbl...
 > Expiry has not been set on the site, because I don't want to set an
 > arbitrary expiry time. I simply want the server to support IE's request
 > with If-Modified-Since in the headers (so it serves the page if it has
been
 > modified since; otherwise doesn't)... which is what used to happen on
 > Apache.
 >
 > From what I can see, this should be the default behaviour on any web
 > server... but for some reason it ain't happening with my IIS 6.

Hi,

IIS is very consequent and conforms the RFC's.

IE does not sent that (if-modified-since) header only if the content from
the previous response did have a last-modified header.

So, if you close IE, and restart it, it even will not use the cached content
from disk. From my experience, the cached content on disk, is only valid
during the session. After restarting IE, it checks the cached content from
disk for having the 'last-modified' attribute, if it is not there, IE simple
does a normal GET...


ps:
The expiration setting for content (which IIS can support), does not really
have to do with the if-modified-since header<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: IIS does not return 304 Not Modified 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]