Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Windows 2008 Server with IIS 7. Uses old (cahced?) pages.

Posted on 2010-08-30
6
Medium Priority
?
1,008 Views
Last Modified: 2012-08-13
Using ASP .Net 4.0 and IIS 7...

We have noticed that after putting new pages on our Windows 2008 Server running IIS 7, that the web server still uses the old page. For instance, we have code behind written in C# that appends an additional URL parameter when a button is clicked. Even though we have copied this new "aspx.cs" page to the server it is still using the old one from it's cache.

I have tried the following:

"touching" (saving) the "web.config" file
Recycling the App Pool
Renaming the "cs" file, hit the page, then rename it back.

Any other ideas on how to force IIS to reload/recompile?

0
Comment
Question by:dbaGrant
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 14

Expert Comment

by:wolfman007
ID: 33568207
As long as you have not precompiled your ASP.NET application using Visual Studio before deploying it then IIS should be recompiling your website every time a change to the source files is made.

Compiling on First Request

By default, ASP.NET Web pages and code files are compiled dynamically when users first request a resource, such as an ASP.NET page (.aspx file), from a Web site. After pages and code files have been compiled the first time, the compiled resources are cached, so that subsequent requests to the same page are extremely efficient.

Recompiling on Change

Any changes to a dynamically compiled file will automatically invalidate the file's cached compiled assembly and trigger recompilation of all affected resources. The next time a request to the code is made, ASP.NET recognizes that the code has changed and recompiles the affected resources of the Web application.

from

Understanding ASP.NET Dynamic Compilation
http://msdn.microsoft.com/en-us/library/ms366723.aspx

If you are not seeing any changes in your ASP.NET website when you are making changes it might be that the pages are being cached in your browser. Try using SHIFT + F5 to force the browser to reload the ASP.NET page direct from the web server.
0
 
LVL 14

Expert Comment

by:wolfman007
ID: 33568239
Sorry its CTRL + F5 to force a refresh

http://www.refreshyourcache.com/en/cache/
0
 

Author Comment

by:dbaGrant
ID: 33572089
Hmm. After a day it is still using the old "aspx.cs" file. We are not "deploying" the changes, we are simply doing a filesystem copy of the file (the new aspx.cs) file.

This is very strang. I know there are no compile errors, we have compiled it locally. Besides, it is a simple append to a redirected URL (something like "&ID=123") that is triggered by a button handler event.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dbaGrant
ID: 33572100
I forgot to mention that we dont precompile.
0
 
LVL 14

Accepted Solution

by:
wolfman007 earned 2000 total points
ID: 33594615
Is it possible that someone has setup Output Caching on your server?

Internet Information Services 7 (IIS 7) includes an output cache feature that can cache dynamic PHP content (or output from your Microsoft® ASP.NET or classic ASP, or other dynamic pages) in memory. This can yield enormous performance improvements, since the script used to generate the dynamic output does not need to run for each request.

IIS supports two ways to invalidate dynamic content:

Use a simple timeout period - the configuration property is CacheForTimePeriod.

Detect a change to the underlying resource - the configuration property is CacheUntilChange. Use this type of invalidation scheme only when you want the cache flushed when the underlying resource changes.

from

Configure IIS 7 Output Caching
http://learn.iis.net/page.aspx/710/configure-iis-7-output-caching/

http://learn.iis.net/page.aspx/154/walkthrough-iis-70-output-caching/

It might be that someone has setup output caching and specified a time period, and your page has been cached. So you are not getting the new version when you make a change.

The cache is fairly easy to configure using the user interface feature in the new IIS administration tool.

1. From the Start menu, click Administrative Tools, and then click Internet Information Services (IIS) Manager.

2. In the tree view on the left side, find your application/website.

3.Select the Output Caching menu item.

Check to see if there are any output caching rules already setup.

If you want to force IIS 7 not to cache aspx pages then you can add a rule for aspx pages.

4. In the right column, click Add in the Action menu. You can add your output caching rule here.

5. In the File name extension field, for example, type .aspx, and then select User-mode caching.

6. The chose one of the radio buttons i.e. using file changes, at time intervals, or prevent all caching.

If you want to test that caching is your problem then choose prevent all caching and see if your page changes as expected.
0
 

Author Comment

by:dbaGrant
ID: 33719891
I will try this. Something else we noticed, is if we use the Visual Studio Solution that is stored in the directory of the web appliation, then the changes take effect immediately. (But, if we say make the changes on a dev server, then copy just the new aspx files, they are cached).

The Output Caching IS setup, but there are no rules. So, does that mean it is caching everything (or nothing)?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question