Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I flush the cache in ASP.NET

Posted on 2008-10-14
2
Medium Priority
?
1,254 Views
Last Modified: 2012-05-05
Hi,

I am relatively new in ASP.NET, trying all sort of things.
I had my first web site published (photo gallery) but wanted to improve performance  because the images were slow to load so I tried the cache for the first time and set the duration of the cached pages to 24 hours.
My initial page used to be a "Welcome.aspx" page which is not cached. It contains a LoginStatus control and a LoginView control. This page was always the first to appear on the site. Now, But now the Default.aspx page shows up first althought the user has not been authenticated and despite the fact the code in the page upload directs unauthenticated users to the Welcome.aspx page.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If User.Identity.IsAuthenticated = False Then
            Response.Redirect("Welcome.aspx")
         end sub

For now I need to flush the cache and see if this would restore the situation to what it was but I am not sure how to do that.

Thanks for your help

Tariq
 
0
Comment
Question by:tariqanis
2 Comments
 
LVL 13

Expert Comment

by:crazyman
ID: 22715266
0
 

Accepted Solution

by:
tariqanis earned 0 total points
ID: 22734041
Hi Crazyman,

I am not sure I understand the usefullness of the code you referred me to.
The cached web pages are already in memory and any code outside these pages (as far as I know) is ignored because it is not looked at.
What I understand is that when a cashed URL is requested the cache supplies it, which means the pages stored in the cache will be rendered and the code in a new page would be ignored.
 I guess the only solution was to replace the pages on the web site with new pages that do not contain the cache tag and wait for the duration of the cache to expire.
Am I mistaken in what I just said??
Please respond because I am trying to learn.

Tariq
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

927 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