Is It Possible To Cache Page On The Server Side

May 19, 2010

Let's assume you have a big complex index page, that shows news articles and stuff. It's not going to change very often. Can you cache it somehow on the serverside, so requests don't force to server to dynamically generate the entire page every time someone visits it? Or does ASP.NET do this automatically? If so, how does it know if something has changed?

View 2 Replies


Similar Messages:

Web Forms :: Display Cache Data Only Instead Of Server Side Code

Feb 7, 2011

I am working on page where data will update in every 10 second by scraping data from other Stock website. So basically page is displaying stock data which update in every 10 seconds. I am using update panel and timer control. Now problem is that if 100 users open the webpage 100 request go server in each 10 seconds. I want to implement Cache on page where Cache version of page serves to other user. I am using <%@ OutputCache Duration="10" VaryByControl="Timer1" %> but when event occur code run intends of delivering Cache version of page. What I am doing for test.

1) Open page in different browser in local

2) Checking browser type using code

Dim s As String = ""
With Request.Browser
s &= "IP = " & HttpContext.Current.Request.UserHostAddress & vbCrLf
s &= "Browser Name = " & .Browser & vbCrLf
End With
Label1.Text = s

if page first open in IE then if I again open in firefox it shows browser type IE but after 10 sec interval it will update type to firefox. So I want to display Cache data only instead of executing server side code for each different browser.

View 1 Replies

Custom Server Controls :: How To Programmatically Cache A Server Control And Add A Cache Dependency?

Feb 11, 2011

I have a server control that I developed which generates navigation based on a third party CMS API. Currently I am caching this control using the PartialCaching attribute. The CMS uses cache key dependencies to invalidate the cache when a user makes an edit, however in the case of my server control it does not get invalidated and the updated navigation will not show up until the cache expiration set by the PartialCaching attribute.Here is my two part question:

What is the proper way to programmatically cache a server control, without using the PartialCaching attribute, and adding a cache key dependency?

Is it possible to continue to use the PartialCaching attribute and add a cache key dependency?

View 2 Replies

Jquery - Options For Page With Matching Client-side And Server-side Markup?

Oct 17, 2010

Suppose I'm building a StackOverflow clone using webforms ASP.NET and jQuery. The Question page has a question, several answers, and comments under each. Requirements:Users can post new answers and comments, and edit existing ones, without postbacks. No UpdatePanels; the AJAX calls retrieve just the JSON they need, not HTML fragments. The page loads with all existing answers and comments in place (no javascript needs to run to read the page).

What I'm trying to figure out is how to do this without having to maintain two sets of markup (one that's bound on the client using some form of jQuery templating, and one that's bound on the server using traditional WebForms).

View 7 Replies

Print The Aspx Page Either Using Server Side Or Client Side Approach?

Feb 9, 2011

I have to implement the print functionality on aspx page like on click of print image icon user will be able to get the print out of aspx page .aspx page will contain the server controls like textboxes , Gridview etc which one approach will be the best server side or client side printing ?

View 4 Replies

C# - How To Pass A Value From Server Side Page To Client Side Function

Jul 30, 2010

In my application I need to pass a string value from the server side(.aspx.cs) to a function in the client side (.aspx) page.

View 4 Replies

Architecture :: Distributed Caching / Keeping Cache In Sync Between Multiple Webservers Or Even Better Farm Cache Management To Another Server?

Feb 26, 2010

I've got a web application that runs of a state server. It looks like soon it may need to distributed and there will be two web servers behind a load balancer.

This works great for session state but my next challenge is Cache

My application leverages heavily of cache. I understand ASP.Net 4.0 will be offering more here but nothing much has been said about the how too.

There are two challenges that I face

1). Each webserver will have its own copy of cache whereas it would be more efficient to put this to a third server the same as session state is put to state server.

2). The real challenge is keeping cache in sync if a simple dataset derived from the database is changed my code dumps that cache item and reloads the cache. That's all well on one webserver but webserver number two wont know to drop that particular cache item and reload it. This could cause some unexpected problems in the application.

For scenario number 2 I could attempt to do some smart coding so server number two knows to dump the cache and reload it.

My guess is someone else has already been here before and there's probably a better implementation approach rather than writing extra code.

Does anyone know how I could achieve the goal of keeping Cache in sync between multiple webservers or even better farm Cache management to another server?

View 2 Replies

Architecture :: Cache The Full List Of Objects In Http Cache On The Service Tier And Page In Memory?

Feb 25, 2011

We have a wfc layer that wraps the business classes and database access and use a client that lives on the database layer. Amongst our group we are attempting to form standards. Some want to have the client call the web method and pass the page they are requesting and the page size. Pass that to the database and then page in SQL Server use RowNum.Some want to cache the full list of objects in http cache on the service tier and page in memory. They concern here is memory use on the server.

Which would be best for a medium number of users with potentially large number of records to manage (say 30K) Is it better to cache them all in memory and work from there or page at the database as the application scales?

View 1 Replies

C# - Setting HttpCacheability.Public Also Cache The Page On The Server?

Mar 24, 2010

I have these lines in my global.asax (basically because of http://stackoverflow.com/questions/2469348/can-i-add-my-caching-lines-to-global-asax)

The thing I want to now understand is whether this code purely adds the HTTP headers to the page or does it also make .Net cache this page on the server for 300 seconds?

Response.Cache.SetExpires(DateTime.Now.AddSeconds(300));
Response.Cache.SetCacheability(HttpCacheability.Public);

View 1 Replies

Is Page Output Cache Stored In.NET Cache Object?

Nov 2, 2010

I need to enable caching in my asp.net application, but I do not want to use the webserver's memory for holding cache objects. If I add the page directive for output caching will the page be stored in the asp.net cache object?

View 2 Replies

Web Forms :: Call Server Side Function Of Parent Page From Popup Page?

Mar 24, 2011

I open a pop up page(child page) by using jquery(jquery.colorbox.js) in asp.net application. now when I click on search button I want to close the pop up page(child page) and refresh the UpdatePanel1 by using search parameters. for above I need to execute server side function in parent page. code to close pop up:

child.aspx:
<script>
function closePopup() {
[Code]....

View 3 Replies

Possible To Call A Server-side Event On A Parent Page When A Child Page Closes

Jan 13, 2010

I have a parent page with two data controls. I want to be able to open a child window, do something on it, and when it closes I want to rebind only one of the two data controls on the parent page. I have the control I want to update within an UpdatePanel so would like to call rebind it and call UpdatePanel.Update().

View 2 Replies

Best Way To Initiate The Page Caching On The Server Side And Serve The Cached Page Upon?

Apr 19, 2010

I'm implementing Outputcache in my application and it works fine, but the first time always take a lot to load and the next following request will be faster...

I would like to know if there is a way to initiate the page caching on the server side and serve the cached page upon the very first request, rather than have it triggered by the user one first time.

View 1 Replies

JQuery :: How To Upload Files In Browser Cache To Get File Size On Client Side

Apr 1, 2011

My requirement is to get the file size in client side. there is no problem in FF but in IE you can't do that unless u r using an activeX object. So we thought of putting it in browser cache and reading the file size from there and when we post it to the server we will be taking it from the cache and send it to the server.

View 4 Replies

Any Nasty Side Affects If I Lock The HttpContext.Current.Cache.Insert Method?

May 4, 2010

Apart from blocking other threads reading from the cache what other problems should I be thinking about when locking the cache insert method for a public facing website.

The actual data retrieval and insert into the cache should take no more than 1 second, which we can live with. More importantly i don't want multiple thread potentially all hitting the Insert method at the same time.

The sample code looks something like:

public static readonly object _syncRoot = new object();

if (HttpContext.Current.Cache["key"] == null)
{
lock (_syncRoot)
{
HttpContext.Current.Cache.Insert("key", "DATA", null, DateTime.Now.AddMinutes(5), Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);
}
}

Response.Write(HttpContext.Current.Cache["key"]);

View 1 Replies

A Page Can Have Only One Server-side Form Tag?

May 26, 2010

I am using master page and when i run this page it show error message which is mention below: a page can have only one server-side form taghow can i solve or fix this problem.

View 3 Replies

Using Eval In Server Side Code On Page?

Apr 20, 2010

<asp:Repeater ID="rptrParent" runat="server">
<ItemTemplate>
<li>
<a href="<% =ResolveUrl("~/cPanel/UserView.aspx?User=")%><%# Eval("StudentUserName") %>">

[code]...

View 2 Replies

Server Side - Themes Won't Work When Using Server Side Tags

Apr 8, 2010

The code for the asp.net page is:

<div class="facebox_content">
<% if (CurrentUser.Role == "Free")
{
%>
<table cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:380px;">
<tr>
<td>

User Name :

</td>
<td>

Membership Cost :

</td>
</tr>
<tr>
<td style="width:190px;">
<asp:TextBox ID="txtUserName" Enabled="false" runat="server" Text="<%= CurrentUser.Name %>"/>
</td>
<td style="width:190px;">
<asp:TextBox ID="txtCost" Enabled="false" runat="server" Text="2000"/>
</td>.........

View 1 Replies

Web Forms :: A Page Can Have Only One Server-side Form Tag Error ?

Dec 19, 2010

I'm very much a newbie to ASP.Net and am getting the "a page can only have one server-side form tag" error. I have searched the internet for clues, but my understanding (or lack of) means I can't adapt other peoples solutions to resolve my problem.My master page has the following code:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

View 1 Replies

Using .NET To Always Run Some Server Side Code When A User Leaves A Page?

Jan 13, 2011

I was wondering if there is any way to always run some server side code when a user leaves a page in ASP.NET. The page Unload event is no good because that doesn't get called if someone clicks on a link. Ideally I'd also like the code to run even if the user closes the browser.

View 4 Replies

Web Forms :: Error: A Page Can Have Only One Server-side Form Tag?

Jan 20, 2010

I m getting this error......

HttpException (0x80004005): A page can have only one server-side Form tag.

View 8 Replies

Iis - Run Server-side Code AFTER Page Render & Sending?

Dec 10, 2010

I need to do stuff after my page is rendered in the browser. In detail, i need to send email/sms and other non-browser related stuff, but the operation takes time, and i dont want my visitors waiting 5-8s for the success message.I have tried putting the "After Rendering Code" in the page Unload event. That seems to work - but only on localhost. It does not work on our production server.So i figgured, maybe this is some IIS setting? I've also read that it's up to the browser, if it will show th epage after rendering is complete - or wait for the whole package to end.So i tried to end the package with Response.end before my "A-R-C", but that just killed it.

View 3 Replies

Web Forms :: Server Side Yes No Confirmation On Page Load

Jan 24, 2016

The article described fine work on Button Click But I want to use On page Load [URL] ....

View 1 Replies

AJAX :: How To Dynamically Set Page Scrollbars Through Server Side Code

May 11, 2010

The scenario is this. I have a long page that has a scroll bar. I'm us an Ajax ModalPopupExtender and that too is very long and has a scroll bar.

The problem I'm seeing is that in IE when a user scrolls the modal popup window, when it reaches the bottom it also scrolls to main window which has a really ugly user experience.

So what I want to do is, through server side code, I want to dynamically change the body css overflow from auto to hidden and I can't seem to find a way to make that happen. I've tried a number of approaches and none of them seem to work.

<body style="overflow:hidden;">

View 2 Replies

Cannot Refresh The Page After Calling Server Side Code Using Javascript

Apr 4, 2011

I am using Ajax's EnablePageMethods way to call server side code using javascript. The problem is that in IE8 the page automatically refreshes after the ajax call has been completed i.e. the server side function has been executed successfully. I want the same to happen with Chrome and Firefox but it doesnt refresh the page once the server side function has been executed.

I am using this way to call server side code from Javascript -- [URL]

this is the javascript function:

[code]...

this is where i am calling the javascript event:

<a href='myPageName.aspx' onclick='javascript:editNode(1);return false;'>Delete</a>

View 1 Replies







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