.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Clear Output Cache

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net

I have set the output cache for 5 pages(5 minutes)

I want to clear  all these pages from cache on some nutton click 

View Complete Post

More Related Resource Links

How to clear cache


We have an ASP.NET-based print tool that will create a printable version of a webpage (as a PNG, I believe). The URL is something like:


which is displaying an older version of the webpage.

The URL to just the webpage displays the current version:


Observations so far:

  • I've deleted temporary Internet files on clients, which had no effect.
  • The behaviour is the same on different clients, which suggests a server issue.
  • I've requested that the temporary ASP.NET files are deleted from:
    C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\mysite_tools_printfromweb
    (It's a customer's web server. I've checked the version of ASP.NET associated with the tool.)

So, my questions are:

Am I right in thinking this is probably a caching issue, and are there any other locations and/or settings I should be looking at?

With thanks.

output cache to be used only when parameter has changed + old question of user control not answered



i have 2 questions about output cache:

1.is it just me , or does it seems that it is used only after the second time that the user reaches the webpage? if so, why, and how can i tweak it to my needs? my guess is that it wouldn't be logical to cache every time a user reach a webpage, but only when it happens enough times.

2.i know that i can use "varybyparam" for using the output cache when the parameter doesn't change , but it seems that it would use the output cache even if there is no parameter , or if the specified paramter is not there. is there a way to overcome this?

3.an old question that somehow marked as "answered" , yet i didn't solve : suppose i created a user control and i gave it values through the CTOR via the aspx file . is it possible to show the values from within the split/design mode? remember that i've talking about ASP.NET and not simply C# winforms . i write this because this question was on :


and the answer that i got was for C# and winforms . i've tried to do the same for ASP.NET , but i've failed.

can anyone please help me?

how to adding dependencies to output cache dynamically?

Suppose i have an controller action that i would like to output cache. public class HomeController : Controller    {        [OutputCache(Duration=10, VaryByParam="none")]        public ActionResult Index()        {            // set  file dependency to the cache            return View();        }    } I need to dynamically set dependency to an external file  inside the code. How can i do that?      

Clear FF and Chrome Cache?



I have this method:

private void EmptyFolder(DirectoryInfo folder)
    //loop through all the files in the folder provided
    foreach (FileInfo file in folder.GetFiles())
        //delete each file
    foreach (DirectoryInfo subfolder in folder.GetDirectories())
        //recursively delete all files and folders
        //in each sub directory

And i call it:

EmptyFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.Cookies)));
EmptyFolder(new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)));

This emptys the IE cache and cookies, i want to clear FF and Chrome as well...

the problem is that its in diffrent places in Vista and XP...

Debbugger does not clear browser cache


VS 2010.

Any time I make a change in a .js file in a project, I have to clear the IE cache before I can see the change when debugging.  A change in an .aspx page does not require that I clear the chache.  There must be a way around this?

Unable to invalidate output cache using RemoveOutputCacheItem


I'm using ASP.NET MVC 3.0.  I'm using the OutputCache attribute to cache a partial view result, which is rendered on my master page using Html.RenderAction.  The caching part works fine, but I cannot invalidate the cache by calling HttpResponse.RemoveOutputCacheItem.  (The partial view remains cached and the action doesn't get called anymore.)  I've been fighting this for a day, I've read all the forum posts on this, and I can't figure out what I'm doing wrong.  There seems to be no documentation on the parameter that gets passed into RemoveOutputCacheItem, and the API gives no indication that something failed.

My partial view looks like this ...

public class HomeController : Controller
    public ActionResult NavBar() 
        return PartialView(model);

In my master page view, I'm using this to render the partial:

    <% Html.RenderAction("NavBar", "Home"); %>

When the user performs an action that would cause the results of /Home/NavBar to change, I call this from within that action:


Comma-Delimited Output

One of the common tasks performed when retrieving data from a SQL Server database is returning the result as a comma-delimited output instead of a result set. This task can be performed by using a CURSOR selecting the column to be concatenated together. Each row returned by the CURSOR is then concatenated together into a variable separating each one by a comma.

Enterprize library 4.1 getting output parameter after adding record in db, plz guide



I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide


Inline conditional output


Is it possible to somehow output some content based upon some conditional check in Razor? If not, I hope this possibility will be added in the future. What I want to do is the following:

<option value="1" @if(ListMode == 1) { = "selected=\"true\"" }>Full list</option>

As I can't figure out a way to do this, I have to either make a helper that does it for me or write duplicate code.

saving XML output from webservice


 I created a webservice that takes casenum as input and gives results as a dataset in an XML.

I could make a web client to display the resulting dataset in a grid view. Pls see my code copied below.

Now I want to create a console client that takes the casenum as input, to call the webservice and saves the resulting xml for further processing, but can't figure out how to just capture the xml to save. Here's the code for my web client. I would appreciate if you could help modify this tocapture the resulting xml to save file locally.

Thank You.

namespace ResultsWebServicesClient
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)

        private void BindDataToGrid(string CaseNum)
            FG_Results results = new FG_Results();
            DataSet ds1 = new DataSet();
            ds1 = results.Get_FG_Results(CaseNum);
            GridView1.AutoGenerateColumns = true;
            GridView1.DataSource = ds1.Tables[0];

        protected void GetResults(object sender, EventArgs e)


AppFabric Cache: Real-World Usage and Integration


Windows Server AppFabric provides a distributed cache for both web and desktop applications. Well show you how to integrate AppFabric caching into your apps, along with some hints for taking advantage of new cache features in the .NET Framework 4.

Andrea Colaci

MSDN Magazine June 2010

Security Briefs: Active Directory Cache Dependencies


If you're not taking advantage of Active Directory, you should be. Learn the benefits from Keith Brown.

Keith Brown

MSDN Magazine July 2007

Cutting Edge: Implement Custom Cache Dependencies in ASP.NET 1.x


One of the most compelling improvements that ASP. NET brought to ASP programming was the Cache object. The Cache has some similarities to the Application object and is a container of global data (as opposed to session-specific data) that features a fair number of innovative characteristics.

Dino Esposito

MSDN Magazine July 2004

Wicked Code: Supporting Database Cache Dependencies in ASP.NET


Developers love the ASP. NET application cache. One reason they love it is that ASP. NET lets them create dependencies between items placed in the cache and files in the file system. If a file targeted by a dependency changes, ASP.

Jeff Prosise

MSDN Magazine April 2003

formula to display all combination output


hi all

i am now think of how to get all the output for all the combinations


given : 1234

output = 1234,1243,2143......and so on.....all 24 possible output

if given : 123

output = all 12 output

if given 12345 , all 120 output...

can someone provide me the algorithm or formula for that ?


How to set session timeout and clear session in asp.net C# ? And kill session when close the web app


hi ,

How to set session timeout and clear session in web.config and login.aspx  ? And when we close the web application , the session must be cleared ?

I have use session.abandon as per below but is not working . Pls advise .


        protected void btnLogout_Click(object sender, EventArgs e)



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend