Solved

How can I flush the cache in ASP.NET

Posted on 2008-10-14
2
1,238 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
Comment Utility
0
 

Accepted Solution

by:
tariqanis earned 0 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

10 Experts available now in Live!

Get 1:1 Help Now