Solved

How can I flush the cache in ASP.NET

Posted on 2008-10-14
2
1,243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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