Solved

Response.Redirect target coming from cache

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

9 Experts available now in Live!

Get 1:1 Help Now