Solved

Response.Redirect target coming from cache

Posted on 2008-10-29
2
554 Views
Last Modified: 2012-06-27
I have an aspx page on a hosted server  that executes a Response.Redirect to another page on my site.  I've updated the called page but the Response.Redirect still has the client browser return the old page.  If I put a URL for the called page directly into the client browser then the new page is executed.  So there appears to be a cache somewhere that the Response.Redirect call pulls data from but that isn't accessed when the client directly puts the URL into the browser.  I've been sure to clear the client browser cache before every call and even rebooted the client machine, so I'm sure the cache isn't in the client.  It acts as if  there's a cache on the hosting server that Response.Redirect calls access before sending the request all the way back to the client.  Does anyone know what might be going on here?

Thanks for any ideas.

steva
0
Comment
Question by:steva
[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
2 Comments
 
LVL 37

Accepted Solution

by:
samtran0331 earned 500 total points
ID: 22842058
>> It acts as if there's a cache on the hosting server

There is a cache on the server.
All IIS servers running ASP.Net maintain a server cache, on your development machine, the cache would be at something like:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
And your app gets cached in there every time you make a change that IIS "sees".
So IIS will confuse all the different versions in there especially if you have a lot of different versions (meaning you change files/code frequently)

It's the same for a real IIS server.

If you're positive you did actually publish the changes to the host, some things I would try:
1. Most hosts provide some type of web interface "control panel" for you to maintain your sites, I would try stopping and restarting the site in question.
2. Make a change to your web.config file (like adding one blank line or something) and save it back to the host...this is similar to #1 in that it will force your app to stop/restart...and the web server might catch the change and re-cache the "broken" page.
3. contact the host to see if they will clear the cache (it requires IIS be stopped, so I don't know how willing they will be to do that as a customer request)
4. if they won't do that...I would try deleting the virtual directory on the host and re-creating it

The bottom line is that server cache gets "confused" (for lack of a better word)...and I've never really found any hard documentation on when/why/what it chooses to cache when dealing with ASP.Net

....also...is this is probably a silly question, but if your code is compiled...all the dll's are up to date right?

0
 

Author Comment

by:steva
ID: 22845983
Thanks for the information.  I ended up solving the problem by using Server.Transfer instead of Response.Redirect. Server.Transfer seems to transfer you directly to the local file, with no intermediate caches.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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