MVC :: Remove ALL Output Cached Pages?

Jan 20, 2011

How do I remove all of the pages I have placed in the output cache? I know you can use
HttpResponse.RemoveOutputCacheItem to remove a single page but how do I "clear" it, i.e. removing ALL pages?

View 5 Replies


Similar Messages:

Web Forms :: Browser Output Doesn't Look Like Web Developer Output Using Nested Master Pages And Css Stylesheets

Apr 18, 2010

First off, suggest better ways if you want rather than patch up this code. I am just starting this project and it is first time I have tried to code a web site so anything you suggest is very much welcomed. I have spent the last 2 and 1/2 days trying to find workable answers to this but none I have found and tried seem to fit. If needed I can email screens shots or code. I am trying to construct a website that will have the same main theme throughout as far as the header, navbars sitemap, and footer go. Naturally the content will vary from page to page. I want to use a single master page and css stylesheet for this main theme and I will change the content format as needed per page because each page may vary somewhat.

However, about 15 of the pages will all use the same format for their content and this format will differ from the rest of the site but the format of the main theme will stay the same. So I am trying to create a nested master page to use to format the just the content area for all these pages while retaining the main theme for the header, etc.. I believe I should use a separate css file with the nested master page to handle the formatting of the content areas for these 15 pages. I have code that looks like it works when viewed in web developer but design view but does not work when viewd through a browser (IE, Chrome, Firefox). So far I have the following done in web developer.

If it helps the code and screen shots follow. Master Page called "Parent.master". For all theme throughout site Nested Master Page called "Lab.master". For the 15 like pages Primary stylesheet file for main theme called "StylesheetNew.css" For site theme Secondary stylesheet file to syle the 15 like formatted pages. It is called Labmaster.css Labs.apsx file to use as first of the 15 like pages.
Finally screens shots from web developer and browser. Sorry try as I might I could not capture screenshots and put them into this post. The problem is that web developer shows all the area (many lines high) with gray background and with the XXX text that I want to allocate for content in the 15 pages. Yet all the browser show is one line of text o a white background followed by the footer. It looks like the LabStyleSheet works in Web Developer but not in a browser.

Parent.master
<%@ Master Language="VB" CodeFile="Parent.master.vb" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]">
<html xmlns="[URL]">
<head id="ParentHeader" runat="server">
<title>HX5</title>
<asp:ContentPlaceHolder runat="server" id="headerPlaceHolder" />
<link href="~/StyleSheetNew.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="wrapper" >
<div id="Header" >
<table class="hdrtbl1" >
<tr>
<td id="hdrtd1" style="width:175px; height:100px;" >
<img id="logo" alt="Logo" src="../Images/logo.png" style="width: 136px; height: 87px" />
</td>
</tr>
</table >
<table class="hdrtbl2" >
<tr><td id="hdrtbl2td1"><b> Providing Professional Technical, Manangement and Business Solution</b></td></tr>
<tr><td id="hdrtbl2td2"> <b> Services since 2004 </b></td></tr>
<tr> <td id="hdrtbl2td3" align="center" ><img id="rdln" alt="RedLine" style=" height:3px;" src="../Images/RedLine.png" /></td></tr>
<tr><td id="hdrtbl2td4" > <b>Committed to Excellence In All We Do</b></td></tr>
</table>
</div>
<div id="navbardiv">
<ul id="topnav">
<li><a href="../pages/about.aspx" >About Us <img style=" border: none; " src="../Images/arrow-down.gif" /></a>
<!--Subnav Starts Here-->
<span>
<a style="font-weight:lighter; " href="#" >Who We Are </a> |
<a href="#">Locations</a> |
<a href="#">Business Classifications</a> |
<a href="#">Contact Us</a> |
</span>
</li>
<!--Subnav Ends Here-->
<li><a href="../pages/services.aspx">Services <img alt="arrow" style="border: none; " src="../Images/arrow-down.gif" /></a>
<!--Subnav Starts Here-->
<span>
<a style="font-weight:lighter; " href="#" >Capabilities</a> |
</span>
<!--Subnav Ends Here-->
</li>
<li><a href="#">Customers <img style=" border: none; " src="../Images/arrow-down.gif" /></a>
<span>
<a style="font-weight:lighter; " href="#" >Subnav Link</a> |
<a href="#">Customer Locations</a> |
<a href="../pages/labs.aspx">Labs</a> |
</span>
</li>
<li><a href="#">Careers <img style=" border: none; " src="../Images/arrow-down.gif" /></a>
<!--Subnav Starts Here-->
<span>
<a style="font-weight:lighter; " href="#" >Joining the HX5 Team</a> |
<a href="#">Current Opportunities</a> |
</span>
</li>
</ul>
</div>
<div id="subnavbar" >
<!-- <asp:SiteMapPath ID="SiteMapPath" runat="server">
</asp:SiteMapPath> -->
</div>
<div id="topContent" style="border-bottom:solid 1px #191970;">
<table>
<tr><td style="height:30px; width:900px;" >
<asp:ContentPlaceHolder id="TopPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</div>
<!-- <div id="mainContent"> -->
<asp:ContentPlaceHolder id="MainPlaceHolder" runat="server" />
<!-- </div> -->
<!-- <div id="lowerContent"> -->
<asp:ContentPlaceHolder id="LowerPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
<!-- </div> -->
<div id="footerContent" style=" height:50px; width:900px; text-align: right; background-color: #ccc; ">
<span style=" font-family: Arial, Helvetica, sans-serif; font-size: xx-small; font-weight: bold; color: #000080; margin: 30px 20px 0px 0px;"> Copyright 2010 HX5, LLC All rights reserved</span></div>
</div>
</form>
</body>
</html>

View 4 Replies

Add Or Update Or Delete Cached Data - Remove The Entire List From The Cache

Jan 17, 2010

U are caching a list of items, then Add or update or delete method called. Approach 1)

A- Do the data change at the database. If success do B, C
B- Remove the entire list from the Cache.
C- Re-Cache the list on first read.

Approach 2)

A- Do the data change at the database, If success do B
B- Do the same change at the cached items, and save more time.

Approach(2) probably will cause nasty difficult to spot bugs, because the data come from BLL and placed directly into cache, One can't assume no bugs will happen at the sproc, I am not worry about database runtime errors, runtime errors will show up, but I am worry about invalid data, or miss calculation. Can I proceed with approach (2) with caution? Is there a "best practice" principle which suggest not doing approach(2)?

View 2 Replies

Web Forms :: Clear Browser Cache And Stop Pages From Being Cached?

Oct 25, 2013

when i first run my applcation some time its showing the data from cache.i want to avoid it in first time .

i want to cache my all images/css/js file what is the efficient way to do it.

i have lot of images folder /js /css files.

View 1 Replies

Web Forms :: Reflect Recently Changed Image File And Remove Cached Image From Browser?

Jul 10, 2013

<asp:Image ID="aspImagePreview" runat="server" AlternateText="Preview" Height="190px" Width="290px" ImageUrl="~/file1.jpg" />

when the file file1 has been changed or removed. How can I do one refresh to the item to make it reflect the recent change?

View 1 Replies

Remove Ajax Scripts From Html Output?

Feb 21, 2010

I am talking about the WebResource and ScriptResouce js files that are added to the page html. They are quite big. On some pages I don't need them, so it is safe to remove them.

It would seem logical just to remove the scriptmanager, however this is not an option. Some pages use ajax based on a query string. and i use an update panel too. So removing the script manager won't work. I thought maybe I could just disable it, but there is no option for that.

So I guess the only option is to remove the scripts from the output html.

View 2 Replies

Output Caching On Static Pages?

Jan 28, 2010

Does output caching help boost the performance of asp.net mvc pages that just consist of html, css, images, and javascript?

View 1 Replies

VS 2010 - How To View Output Of ASPX Pages On Website

Sep 25, 2011

I'm using a hosting service and I tried putting the default pages (that you get when you make a new website in web developer) onto the hosting service. But they only show up "normally" when I change the extension to html. if it's .aspx it just shows the code.

Question is how can I view the aspx file in the browser from the website normally without using "View in Browser" in that popup menu in Visual Studio Web Developer? And side note I can't use IIS (don't know if that's important but other places talked about it)

View 5 Replies

VS 2005 Finding Alternative To Declare Output Cache In All 200 Pages

Jan 20, 2010

I create a menu control in a user contol, named as RightUserrControl.ascx.

and i kept this RightUserrControl.ascx in nearly in 200 pages.

every thing is working fine , but when ever i am going to any page the page loading is very slow, nearly each page is taking 1 minute to load.

set caching for the user control, if this is the case , do i need to declare output cache in all 200 pages or is there any alternative way to resolve this issue.

View 8 Replies

State Management :: Setting The Output Cache For 5 Pages (5 Minutes)?

Aug 27, 2010

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 2 Replies

Completely Remove ViewState For Specific Pages?

Mar 12, 2010

I have a site that features some pages which do not require any post-back functionality. They simply display static HTML and don't even have any associated code. However, since the Master Page has a <form runat="server"> tag which wraps all ContentPlaceHolders, the resulting HTML always contains the ViewState field, i.e:

<input
type="hidden"
id="__VIEWSTATE"
value="/wEPDwUKMjEwNDQyMTMxM2Rk0XhpfvawD3g+fsmZqmeRoPnb9kI="
/>

EDIT: I tried both variants of setting EnableViewState on page level with no luck at all:

<%@ Page Language="C#" EnableViewState="false" %>
<%@ Page Language="C#" EnableViewState="true" %>

I realize, that when decrypted, this value of the input field corresponds to the <form> tag which I cannot remove because it is on my master page. However, I would still like to remove the ViewState field for pages that only display static HTML. Is it possible?

View 6 Replies

Crystal Reports :: Remove The Default Space Between Two Pages In Crosstab Report?

Jul 3, 2010

How can i remove the default space between two pages in Crosstab report

View 1 Replies

Web Forms :: How To Remove The Row Where The Remove Button Is Clicked

May 28, 2010

how do I write a code for the remove button I want to remove the row where the remove button is clicked. he code for my webform is below

html code for remove
<td>
<asp:LinkButton runat="server" ID="lnkbtnRemove" Text="Remove" OnClick="lnkRemoveGuest_Click" ></asp:LinkButton>

[Code]....

View 13 Replies

Page Not Being Cached?

Nov 29, 2010

why all the resources in my page are being requested EVERY single time. E.g. my site.css returns the following headers (using fiddler):

HTTP/1.1 200 OK
Server: ASP.NET Development Server/9.0.0.0
Date: Mon, 29 Nov 2010 17:36:21 GMT
X-AspNet-Version: 2.0.50727
Content-Length: 9093
Cache-Control: public, max-age=2592000
Expires: Wed, 29 Dec 2010 17:36:21 GMT
Last-Modified: Mon, 08 Nov 2010 17:20:16 GMT
Content-Type: text/css
Connection: Close

But every time I hit refresh I see all the resources (css,js,images) getting re-requested. I have control over the headers returned for any and all of these resources, but I haven't figured it out yet.I have even debugged my ASP.NET app and the HttpModule is definitely being asked for the resources again.

EDIT:Ok, I removed must-revalidate, proxy-revalidate from the headers and that is getting me closer to where I want to be, now when I press back it still requests my css/js files when I press back.

View 2 Replies

C# - How To Add An Item To A Cached Collection

Mar 29, 2011

I would like to cache a collection in the viewstate, but I wonder if there is a better way to add an item to this collection!

private List<MyClass> CachedItems
{
get { return (List<MyClass>)ViewState["CachedItems"]; }
set { ViewState["CachedItems"] = value; }
}
private void AddToCachedItems(MyClass item)
{
CachedItems = CachedItems.Concat(new[] { item }).ToList();
}

View 1 Replies

Possible To Detect Whether An ASP.NET Page Is About To Be Cached

Apr 20, 2010

Is it possible to detect whether an ASP.NET Page is about to be cached and if so, how?The HttpCachePolicy object provides only set-methods. The VaryByParams name-value collection is useless if values other than "None" and "*" are set as it impossible to enumerate them and you can only access them by key

View 1 Replies

Javascript - .NET Specify Which Files Should Be Cached?

Jan 14, 2010

I am developing a website in ASP.NET and I am using various javascript frameworks/libraries. The different files belonging to these frameworks/libraries rarely changes thus there is no reason to refresh those files once they have been sent to the client browser (atleast not everytime a page is served).I see that the HttpContext object can be used somehow, that I can set the content expiration on the files/folders on the IIS, or maybe setup somekind of caching in the web.config file. 1. What is best practice/what approach should I take

View 2 Replies

Check The Value Of A Cached Dictionary?

Oct 22, 2010

Not really sure how to do this but i can cache the dictionary like this:

Cache.Insert("CacheName", Dictionary)

need some direction. the dictionary is two string values taken from a database. The user will input a string and i need to compare it against the values in the cached dictionary.

View 2 Replies

Modify An Object From Cache And It Changes The Cached Value

May 8, 2010

I'm having an issue when using the Asp.Net Cache functionality. I add an object to the Cache then at another time I get that object from the Cache, modify one of it's properties then save the changes to the database.

But, the next time I get the object from Cache it contains the changed values. So, when I modify the object it modifies the version which is contained in cache even though I haven't updated it in the Cache specifically. Does anyone know how I can get an object from the Cache which doesn't reference the cached version?i.e.

Step 1:
Item item = new Item();
item.Title = "Test";
Cache.Insert("Test", item, null, DateTime.Now.AddHours(1), System.Web.Caching.Cache.NoSlidingExpiration);

Step 2:
Item item = (Item)Cache.Get("test");
item.Title = "Test 1";

Step 3:
Item item = (Item)Cache.Get("test");
if(item.Title == "Test 1"){
Response.Write("Object has been changed in the Cache.");
}

I realise that with the above example it would make sense that any changes to the item get reflected in cache but my situation is a bit more complicated and I definitely don't want this to happen.

View 2 Replies

C# - How To Invalidate Cache When The File Which Is Cached Changes

Dec 17, 2010

I read few xml files from a location and cache them using Http context cache. Anytime the xml files changes i have to do a IISReset to view the latest changes.

I use this

System.Web.HttpContext.Current.Cache

I have to use the caching as i don't want to read all the xml files all the time. i read it once and caches them for a day. They get reset whenever apppool recyles or anyone manualy do a IISReset.

Is there anyway in asp.net to invalidate the cache if someones changes the xml file.

View 1 Replies

C# - Web Page Still Displaying Cached Versions

May 3, 2010

My web page is still displaying a previously cached versions of the page. I have this in the page_load event:

Response.Clear();
Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1;
Response.CacheControl = "no-cache";
Response.Cache.SetCacheability(HttpCacheability.NoCache);

I have this in the Page_Init:

protected void Page_Init(object Sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddDays(-1));
}

View 2 Replies

Tsql - .Net MVC Best Way To Update Cached Table

Apr 19, 2010

There are certain tables that get called often but updated rarely. One of these tables is Departments. So to save DB trips, I think it is ok to cache this table taking into consideration that the table has very small size. However, once you cached it an issue of keeping the table data fresh occurs. So what is the best way to determine that the table is dirty and therefore requires a reload and how that code should be invoked. I look for solution that will be scalable. So updating the cache on single right after inserting will not resolve the issue. If one machine inserted the record all other on the farm should get notified to reload the cache.

View 3 Replies

CSS In App_Theme Folder Gets Cached In Browser?

Dec 23, 2010

The Stylesheet in the App_Theme folder gets cached in the browser. What should be the approach? so that whenever there is a new deployment the browser should take the latest stylesheets and not the one cached in the browser.

This was happening for other css(which are not in theme folder) too, so used custom control as mentioned in the link

[URL]

How this could be done for the CSS in the Theme folder?

Edit: The theme name is mentioned in the web.config as mentioned below. so its not just the html link tag which I had solved by using the method mentioned in the link.

<pages styleSheetTheme="Default">
<controls>
</controls>
</pages>

View 3 Replies

C# - Prevent Scripts From Being Cached Programmatically?

Feb 21, 2011

I would like to ask if there is a way to prevent Firefox from caching scripts (.js files).

I have a project (ASP.Net Web App) with caching issue on firefox. When I first run the application (script is being cached on firefox) and modify the script and rerun the application, firefox is using the cached script instead of the updated one.

I'm using Firefox 3.6.13.

I already tried using HttpHeaders but it seems like firefox is ignoring my codes.

Here is my code:

HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
HttpContext.Current.Response.Cache.SetNoStore();

I tried placing this code at global.asax > Application_BeginRequest and at MasterPage.aspx.cs > Page_Load, but it isn't working.

View 3 Replies

.NET - Refreshing A Posted Page That Isn't Cached On IE

Mar 6, 2010

Lets say you have a page with headers that tell the browser not to cache.Also, this page has already been posted back to itself.Now you hit the refresh button and you click cancel on the IE modal box with the "previously submitted..." message.You get "Webpage has expired". This doesn't happen in FF or Chrome.Is there a way to prevent the "Webpage has expired" message in IE?Since the page isn't cached, I guess IE has nothing to render.But if the page isn't cached and FF and Chrome shows it, I guess they just show the page as previously shown?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved