Solved

How can I flush the cache in ASP.NET

Posted on 2008-10-14
2
1,239 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

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

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 …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 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

13 Experts available now in Live!

Get 1:1 Help Now