Solved

Response.Redirect target coming from cache

Posted on 2008-10-29
2
548 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now