Solved

Response.Redirect target coming from cache

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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.…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

825 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