Solved

How can I flush the cache in ASP.NET

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 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