?
Solved

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

Posted on 2010-08-30
6
Medium Priority
?
1,006 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

752 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