473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Content Expiration Question

Using ASP.NET 1.1 and IIS 6... what is the effect of enabling Content
Expiration -- Expire Immediately?

Does it cause the files in the virtual directory to be served on every
single browser request even if the files do not change?

The reason I ask is that I was having trouble with a css file not getting
refreshed in the browser after the css file was updated on the server. In
testing I found that I could manually update the css file on the server (via
Notepad) and the browser would not get the updated CSS file. And yes, I
purged the cache, deleted local files, rebooted the local machine, tested in
a variety of browsers, etc. New browser sessions would continue to receive
the old version of the css file. The only thing I could reliably do to cause
the newly saved css file to be served was to recycle the App pool . The
hosting provider then enabled Content Expiration -- Expire Immediately and
that seems to solve the problem. My concern is that the css file(s) will now
get served up unnecessarily (i.e., even when they haven't been updated).

Thoughts? Suggestions?

Thanks!
Nov 19 '05 #1
5 1896
Oops! I spoke too soon.

Enabling content expiration does not solve the problem. That is, updated css
files are still not served to requesting clients.

Here's the only thing I have been able to do to reliably get new css files
to get served:
1. Recycle the application pool (via IIS Manager).

NONE of these things cause the current CSS file to go into effect:
1. Hitting F5 in IE
2. Hitting Shift + F5, nor Ctrl + F5
3. Deleting files in the browser (via Internet Options in IE)
4. Starting a new browser session
5. Rebooting the client and requesting the page again.
6. Restarting the ASP.NET Application (by saving an inconsequential change
to the app's Web.config)

Any ideas? Any direction for me to go to get more info to help narrow this
down?

Thanks!


"Frankie" <A@B.COM> wrote in message
news:uY**************@TK2MSFTNGP15.phx.gbl...
Using ASP.NET 1.1 and IIS 6... what is the effect of enabling Content
Expiration -- Expire Immediately?

Does it cause the files in the virtual directory to be served on every
single browser request even if the files do not change?

The reason I ask is that I was having trouble with a css file not getting
refreshed in the browser after the css file was updated on the server. In
testing I found that I could manually update the css file on the server
(via Notepad) and the browser would not get the updated CSS file. And yes,
I purged the cache, deleted local files, rebooted the local machine,
tested in a variety of browsers, etc. New browser sessions would continue
to receive the old version of the css file. The only thing I could
reliably do to cause the newly saved css file to be served was to recycle
the App pool . The hosting provider then enabled Content Expiration --
Expire Immediately and that seems to solve the problem. My concern is that
the css file(s) will now get served up unnecessarily (i.e., even when they
haven't been updated).

Thoughts? Suggestions?

Thanks!

Nov 19 '05 #2
Does your project in VS include these files? the directory in which they
reside?

If so, then they may not be resent to the client until the "application" is
recycled.

If they are included, right-click them in the solution explorer and
"exclude" them from the project. This will eliminate any dependency that the
application maintains about them but they can still be referenced by your
project. Otherwise the web server/ASP.NET will cache a prior version of them
until the application is reset.

This should also be done for any other files in the project that might be
changing on the fly.

Hope this helps...

"Frankie" wrote:
Oops! I spoke too soon.

Enabling content expiration does not solve the problem. That is, updated css
files are still not served to requesting clients.

Here's the only thing I have been able to do to reliably get new css files
to get served:
1. Recycle the application pool (via IIS Manager).

NONE of these things cause the current CSS file to go into effect:
1. Hitting F5 in IE
2. Hitting Shift + F5, nor Ctrl + F5
3. Deleting files in the browser (via Internet Options in IE)
4. Starting a new browser session
5. Rebooting the client and requesting the page again.
6. Restarting the ASP.NET Application (by saving an inconsequential change
to the app's Web.config)

Any ideas? Any direction for me to go to get more info to help narrow this
down?

Thanks!


"Frankie" <A@B.COM> wrote in message
news:uY**************@TK2MSFTNGP15.phx.gbl...
Using ASP.NET 1.1 and IIS 6... what is the effect of enabling Content
Expiration -- Expire Immediately?

Does it cause the files in the virtual directory to be served on every
single browser request even if the files do not change?

The reason I ask is that I was having trouble with a css file not getting
refreshed in the browser after the css file was updated on the server. In
testing I found that I could manually update the css file on the server
(via Notepad) and the browser would not get the updated CSS file. And yes,
I purged the cache, deleted local files, rebooted the local machine,
tested in a variety of browsers, etc. New browser sessions would continue
to receive the old version of the css file. The only thing I could
reliably do to cause the newly saved css file to be served was to recycle
the App pool . The hosting provider then enabled Content Expiration --
Expire Immediately and that seems to solve the problem. My concern is that
the css file(s) will now get served up unnecessarily (i.e., even when they
haven't been updated).

Thoughts? Suggestions?

Thanks!


Nov 19 '05 #3
usually ccs files (*.css) are not served up by asp.net but by IIS directly.
IIS will pass the modified date on a get/head request.

for link files like *.ccs, the browser usually caches them by browser
session (until you exit the browser). with a new session, the browser does a
head request to see if the file has been modified, if so it reloads.
generally all you need to is hit the refresh button in the browser to reload
the css/image files, but IE is a little buggy. somestimes you have to exit
the browser and restart.

if your css files are actually *.aspx pages, asp.net should do the correct
caching for you if you are editing the aspx file.

-- bruce (sqlwork.com)
"Frankie" <A@B.COM> wrote in message
news:uY**************@TK2MSFTNGP15.phx.gbl...
Using ASP.NET 1.1 and IIS 6... what is the effect of enabling Content
Expiration -- Expire Immediately?

Does it cause the files in the virtual directory to be served on every
single browser request even if the files do not change?

The reason I ask is that I was having trouble with a css file not getting
refreshed in the browser after the css file was updated on the server. In
testing I found that I could manually update the css file on the server
(via Notepad) and the browser would not get the updated CSS file. And yes,
I purged the cache, deleted local files, rebooted the local machine,
tested in a variety of browsers, etc. New browser sessions would continue
to receive the old version of the css file. The only thing I could
reliably do to cause the newly saved css file to be served was to recycle
the App pool . The hosting provider then enabled Content Expiration --
Expire Immediately and that seems to solve the problem. My concern is that
the css file(s) will now get served up unnecessarily (i.e., even when they
haven't been updated).

Thoughts? Suggestions?

Thanks!

Nov 19 '05 #4
Since my last post in this thread I stopped and started the Web site in IIS
Manager. Problem disappeared (I could no longer duplicate it).

Bruce - FWIW: my css files are actually css files (not aspx pages).

As Brad noted, restarting the ASP.NET Web application is necessary
sometimes; and in my case the files were already NOT included in the
project). In my troubleshooting efforts I had been restarting the ASP.NET
App by saving a change to Web.config. But apparently that's not the same as
Stopping and Starting the IIS Web site.

The only thing unusual about my aspx pages is that I'm injecting the [path
to the css file] into the <HEAD> at runtime. I'm not injecting CSS Classes -
just the path to the css file. Doing that was fine during development and
for a long time in production, and now it's fine again - it's just that
*something* mysterious (to me anyway) happened and Stopping and Starting the
Web site in IIS aparently cleared it up - even though recycling the
Application Pool did not clear it up.

While I can no longer reproduce the issue, I still don't know what caused
the issue in the first place. I'd hate to let it go at this. Any suggestions
for followup, or would I really need to wait and see if it happens again?

-F
"Bruce Barker" <br******************@safeco.com> wrote in message
news:OY**************@TK2MSFTNGP14.phx.gbl...
usually ccs files (*.css) are not served up by asp.net but by IIS
directly. IIS will pass the modified date on a get/head request.

for link files like *.ccs, the browser usually caches them by browser
session (until you exit the browser). with a new session, the browser does
a head request to see if the file has been modified, if so it reloads.
generally all you need to is hit the refresh button in the browser to
reload the css/image files, but IE is a little buggy. somestimes you have
to exit the browser and restart.

if your css files are actually *.aspx pages, asp.net should do the correct
caching for you if you are editing the aspx file.

-- bruce (sqlwork.com)
"Frankie" <A@B.COM> wrote in message
news:uY**************@TK2MSFTNGP15.phx.gbl...
Using ASP.NET 1.1 and IIS 6... what is the effect of enabling Content
Expiration -- Expire Immediately?

Does it cause the files in the virtual directory to be served on every
single browser request even if the files do not change?

The reason I ask is that I was having trouble with a css file not getting
refreshed in the browser after the css file was updated on the server. In
testing I found that I could manually update the css file on the server
(via Notepad) and the browser would not get the updated CSS file. And
yes, I purged the cache, deleted local files, rebooted the local machine,
tested in a variety of browsers, etc. New browser sessions would continue
to receive the old version of the css file. The only thing I could
reliably do to cause the newly saved css file to be served was to recycle
the App pool . The hosting provider then enabled Content Expiration --
Expire Immediately and that seems to solve the problem. My concern is
that the css file(s) will now get served up unnecessarily (i.e., even
when they haven't been updated).

Thoughts? Suggestions?

Thanks!


Nov 19 '05 #5
Frankie wrote:

[...]
While I can no longer reproduce the issue, I still don't know what
caused the issue in the first place. I'd hate to let it go at this.
Any suggestions for followup, or would I really need to wait and see
if it happens again?


During development you could mark your files non-cacheable -- this will
ensure you always run with your latest CSS.

Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: F | last post by:
Hi All I am having problem of content expiration it expires immidiately. Real problem is I am replacing some images on mouse over. On every mouse over its downloading images from server that...
4
by: Rickey Tom | last post by:
This has to be a very common question, but my search did not come up with an answer. I needed to set an expiration time for a cookie. In .NET, is seems that the server-side code is used to set...
1
by: Rudy Mark | last post by:
I have set content expiration in IIS 5.0 to N1 minutes. Also I have code as <meta http-equiv="refresh" content="N2">. Which will be effective in this secnarios ? Which one takes precedence....
1
by: Mario Hébert | last post by:
I have a simple C# object(class) that I reference in a <OBJECT classid="mydll.dll#nmsp.Ctrl"> tag of an HTML page generated by ASP.net. In a case where the Enable content expiration isn't checked...
15
by: Oleg Leikin | last post by:
Hi, (newbie question) I've created some simple .NET ASP application that should store cookies at the client machine. According to the documentation cookie expiration time is set via...
0
by: theintrepidfox | last post by:
Dear Group Just noticed that there's a problem with Visual Studio and IIS Content Expiration. I do have a files sub directory and had Contend Expiration set to immediately for that folder. ...
0
by: TR | last post by:
If mypage.aspx is set to expire immediately using the management console page properties dialog, HttpHeaders tab, -- does the expiration setting take effect as soon as the dialog changes are...
2
by: Jason Kendall | last post by:
I've noticed that my ASP.Net projects suffer from being cached locally when my users' broswers are set to automatically check for newer pages. Folks will go through the process of 'adding' an item...
0
by: mohdowais | last post by:
I have just stumbled upon an what seems to be a very under-rated feature in IIS - the "Enable Content Expiration" option under a website's properties. I have an ASP.NET web application that has a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.