473,394 Members | 1,932 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,394 software developers and data experts.

ASP.net caches aspx Pages

Hallo,
I have a strange problem:
ASP.net caches my aspx pages, the code not the output.
For testing is created a page and inserted the folowing into the body:
<%=now.tostring%>
Every time I reload the page the correct date is shown.

So far so good. Now I add the following line:
<br>test12345

The page still shows the correct time everytime I realod, but the line above
does not appear until I restart the server.

The problem is that the aspx pages are compiles once and stored in the
Temporary ASP.NET Files directory. When I change one site it is not
recompiled until I restart the server.

What can I do?

Nov 18 '05 #1
8 1050
By adding: <br>test12345 to the .aspx page, you have NOT changed the
"code", you've changed the HTML. Simply re-saving the .aspx page with the
altered HTML will make the page update in page requests by browsers. If
yours isn't, my guess is that it is your browser that is caching the page,
not the server.

When I update any of the CODE in my web site (code that is in my code-behind
file), I will need to recompile my assembly (no need to restart the server
though). When I make a change to the HTML in the .aspx page, simply
re-saving the page is all that is required.
"Thorsten Tarrach" <th********@gmx.de> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
Hallo,
I have a strange problem:
ASP.net caches my aspx pages, the code not the output.
For testing is created a page and inserted the folowing into the body:
<%=now.tostring%>
Every time I reload the page the correct date is shown.

So far so good. Now I add the following line:
<br>test12345

The page still shows the correct time everytime I realod, but the line above does not appear until I restart the server.

The problem is that the aspx pages are compiles once and stored in the
Temporary ASP.NET Files directory. When I change one site it is not
recompiled until I restart the server.

What can I do?

Nov 18 '05 #2

"Scott M." <s-***@BADSPAMsnet.net> schrieb im Newsbeitrag
news:e3*************@tk2msftngp13.phx.gbl...
By adding: <br>test12345 to the .aspx page, you have NOT changed the
"code", you've changed the HTML. Simply re-saving the .aspx page with the
altered HTML will make the page update in page requests by browsers. If
yours isn't, my guess is that it is your browser that is caching the page,
not the server.
You are right. I change the HTML and save it.
When I update any of the CODE in my web site (code that is in my code-behind file), I will need to recompile my assembly (no need to restart the server
though). When I make a change to the HTML in the .aspx page, simply
re-saving the page is all that is required.


Before I reinstalled the system that was true for me too.
The page is NOT cached in the browser because the time is updated (you
remember <%=now.tostring%>).

Same thing happens if I change the code behind and recompile the assembly.
The newly added code is simply ignored. The problem is that the Temporary
ASP.NET Files folder does not change.

Nov 18 '05 #3
You have to shut down your browser and then you will see the new code
reflected. This is the correct behavior. When IIS detects a newer version
of the assembly, it will abandon the cached version ONLY when no one is
using it any longer.

Simply calling refresh is not enough, since IIS can tell by your session ID
that you are not a NEW user and it doesn't want to apply the new assembly to
you, since you've already initiated a session using the old one.
"Thorsten Tarrach" <th********@gmx.de> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...

"Scott M." <s-***@BADSPAMsnet.net> schrieb im Newsbeitrag
news:e3*************@tk2msftngp13.phx.gbl...
By adding: <br>test12345 to the .aspx page, you have NOT changed the
"code", you've changed the HTML. Simply re-saving the .aspx page with the altered HTML will make the page update in page requests by browsers. If
yours isn't, my guess is that it is your browser that is caching the page, not the server.


You are right. I change the HTML and save it.
When I update any of the CODE in my web site (code that is in my

code-behind
file), I will need to recompile my assembly (no need to restart the server though). When I make a change to the HTML in the .aspx page, simply
re-saving the page is all that is required.


Before I reinstalled the system that was true for me too.
The page is NOT cached in the browser because the time is updated (you
remember <%=now.tostring%>).

Same thing happens if I change the code behind and recompile the assembly.
The newly added code is simply ignored. The problem is that the Temporary
ASP.NET Files folder does not change.

Nov 18 '05 #4
Hallo,
here comes the solution.
The problem was that the Inetpub was physically stored on d: and linked to
c:\inetpub which was used by all applications.
The aspnet process is obviously not able to trace changes I perform on
c:\inetpub.
Thorsten

Nov 18 '05 #5
You have an InetPub on your C and your D drives? Then you have 2
installations of IIS. One would not be "linked" to the other, but I'm
wondering how you can have IIS (a Windows service) installed twice?
"Thorsten Tarrach" <th********@gmx.de> wrote in message
news:eD*************@TK2MSFTNGP10.phx.gbl...
Hallo,
here comes the solution.
The problem was that the Inetpub was physically stored on d: and linked to
c:\inetpub which was used by all applications.
The aspnet process is obviously not able to trace changes I perform on
c:\inetpub.
Thorsten

Nov 18 '05 #6

"Scott M." <s-***@BADSPAMsnet.net> schrieb im Newsbeitrag
news:Ov**************@TK2MSFTNGP09.phx.gbl...
You have an InetPub on your C and your D drives? Then you have 2
installations of IIS. One would not be "linked" to the other, but I'm
wondering how you can have IIS (a Windows service) installed twice?


No, I just copied Inetpub com C to D and deleted the directory on C. Then I
created a Link on C pointing to D. It's not a simple link windows explorer
creates, but an NTFS junction which really causes programms to believe this
directory is stored on C.
Normally this works fine, but the aspnet process is obviously confused by
this construction.

Nov 18 '05 #7
Why do it this way? So in IIS, it still looks like it's pointing to
c:\inetpub? Why not just change it to d:\ and remove this 'link'? I'm sure
you may have reasons for it, but it just seems like it would lead to
problems.

Brian
"Thorsten Tarrach" <th********@gmx.de> wrote in message
news:O6**************@TK2MSFTNGP09.phx.gbl...

"Scott M." <s-***@BADSPAMsnet.net> schrieb im Newsbeitrag
news:Ov**************@TK2MSFTNGP09.phx.gbl...
You have an InetPub on your C and your D drives? Then you have 2
installations of IIS. One would not be "linked" to the other, but I'm
wondering how you can have IIS (a Windows service) installed twice?
No, I just copied Inetpub com C to D and deleted the directory on C. Then

I created a Link on C pointing to D. It's not a simple link windows explorer
creates, but an NTFS junction which really causes programms to believe this directory is stored on C.
Normally this works fine, but the aspnet process is obviously confused by
this construction.

Nov 18 '05 #8

"Brian H" <no****@nospam.com> schrieb im Newsbeitrag
news:e0**************@TK2MSFTNGP11.phx.gbl...
Why do it this way? So in IIS, it still looks like it's pointing to
c:\inetpub? Why not just change it to d:\ and remove this 'link'? I'm sure you may have reasons for it, but it just seems like it would lead to
problems.


Yes, I changed it now.
Normally linking is the easiest way to avoid any problems after moving a
folder. For example after moving my whole user profile to d: and linking it
back to c:\documents... windows didn't notice the change.

Nov 18 '05 #9

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

Similar topics

5
by: Phil Powell | last post by:
I created a page that will be doing image resizing and manipulation, which seems to work (using GD library). However, upon returning to the page where the image has been changed, I still see the...
1
by: Paul | last post by:
Title: What are the Consequences of Aspx page separate from app DLL Hi JL; I am working on a big asp.net application. When we migrate the dll (or dlls) to the production server, all users who are...
8
by: Thorsten Tarrach | last post by:
Hallo, I have a strange problem: ASP.net caches my aspx pages, the code not the output. For testing is created a page and inserted the folowing into the body: <%=now.tostring%> Every time I...
7
by: J Smithers | last post by:
I have several ASPX pages (with code-behind logic) that I reuse amongst many Web sites on the same production server. Currently each Web site has its own copy of these aspx pages. I was thinking...
2
by: Janusz Jezowicz | last post by:
Hello! I would like to have one page on the server, which would be a target processing page for a number of other aspx pages. E.g Processing page \portal_page.aspx Target pages
3
by: Mike Dee | last post by:
I posted this back in November 2005 a couple times but did not get any responses. I'm hoping someone here can please shed some light on this. I'm new to index server and can't get any DocTitle...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
3
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... At least by the group title, this seems like a question for dotnet.framework.aspnet.caching but that group seems pretty slow. I'm trying to sort things out with a co-worker. We've got...
8
by: Wessel Troost | last post by:
We are using an XML data source in the Page_Load event of an ASP.NET page, like: protected void Page_Load(object sender, EventArgs e) { // Retrieve XML from web service for product idea in URL...
0
by: jason-sage | last post by:
Hi all, I just started using the warnings module in Python 2.5.2. When I trigger a warning using the default warning options, an entry is created in a module-level cache so that the warning is...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.