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


Similar Messages:

Caching - How To Cache A List Of Objects

Jan 23, 2010

I have a List of objects in an asp.net page. when the page loads in the browser for the first time, I fetch data from the database, create objects with those data and populate the list. All these are done inside the page load event handler. Now when the page is posted back to the page, the previous list is gone, since the variables were all freed.

How can I cache that List, so that when this page is posted back, all my objects are available?

View 5 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

Lose JavaScript From The Browser Cache After A Full Page Postback?

Apr 22, 2010

I have an external javascript file which I include to my page on the code behind (as seen below).

My problem is, when I my page makes a postback (not partial one), I check the loaded scripts by using FireBug, and I cannot see the javascript file in the list after the post back. I asusmed once it is included to page on the first load, browser will be caching it so that I do not need to re-include it.

What am I doing wrong?

[code]...

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

C# - Find Out How Much Memory Is Currently Consumed By Cache

Nov 8, 2010

I'd like to modify the value of my Sliding Expiration time span based on how much memory is available. If the site's traffic is high at any point in time, more data will be added to the cache than during quieter periods. During those quiet periods I can increase the sliding expiration time span, thus allowing data to be stored longer. But when the site is busy I need to free up memory so I'm happier with a shorter time span.

So I guess my questions are as follows: Is it possible for me to find out how much memory is being consumed by the items I've added to HttpRuntime.Cache? If so, how? Does this sound like a realistic solution to the problem I've described?

View 1 Replies

Caching - Controlling Output Cache Memory Usage?

May 17, 2010

I would like to use output caching with WCF Data Services and although there's nothing specifically built in to support caching, there is an OnStartProcessingRequest method that allows me to hook in and set the cacheability of the request using normal ASP.NET mechanisms.

But I am worried about the worker process getting recycled due to excessive memory consumption if large responses are cached. Is there a way to specify an upper limit for the ASP.NET output cache so that if this limit is exceeded, items in the cache will be discarded?

I've seen the caching configuration settings but I get the impression from the documentation that this is for explicit caching via the Cache object since there is a separate outputCacheSettings which has no memory-related attributes.

Here's a code snippet from Scott Hanselman's post that shows how I'm setting the cacheability of the request.

[code]....

View 1 Replies

Cache Stores Values On The Memory Of The Client Or On The Server?

Mar 30, 2010

NET Cache stores values on the memory of the client or on the server?If it stores on the memory of the client then can i store the values in Cache instead of cookies - as this will improve speed of my application

View 4 Replies

State Management :: Deleting Data In Cache Memory?

Mar 4, 2011

I have a webpage which displays some data along with a banner. The banner image is stored in the database with parameters "Pagename" and "form".

The application has been coded in such a way that when the page loads , a function checks for the banner in cache memory first with the parameters "pagename" and "form". It the banner does not exist, the new banner is retrieved from the database and is added to the cache memory. Next time when the same page is called, the banner is displayed from the cache memory avoiding the DB to be hit everything to get the banner.

Now, I do not want a specific banner to be displayed on the page. I have removed that banner from the DB but the banner still gets displayed as this banner is still there in the cache memory.

Is there any way to delete the banner which exists in cache memory without making any code changes?

View 5 Replies

Asp.net - Store Unserializable Objects Into The Cache?

Mar 3, 2011

I've seen numerous examples of people storing DataTables into the Cache, but I am just wondering, do the same rules apply to the Cache that apply to the Session? The one rule I am most concerned with is:Do not store unserializable objects into the Session. Just because you can doesn't mean it is guaranteed to work So ultimately my question is:Can you store unserializable objects into the Cache?I reasearched this for a while, reading numerous posts and even reading the chapter about Cache in my ASP.NET 3.5 book and I cannot find it anywhere.I am going to put my DataTable into a DataSet then into the Cache,but is this necessary?

View 3 Replies

C# - Implement System.Web.Caching.Cache Object In A Controller To Cache Specific Query?

Mar 29, 2010

Is it correct to implement my caching object like this in my controller :

[code]....

And I Use it like this :

[code]....

View 1 Replies

New-Cache Parameters For AppFabric Cache When Storing.NET Session State

Jul 28, 2010

What are the "optimal" parameters for creating an AppFabric cache when you will be storing session state in the cache? MSDN Cache-Related Commands

Powershell command line:

New-Cache [-CacheName] <String> [-Eviction <String>] [-Expirable <String>] [-Force [<SwitchParameter>]] [-NotificationsEnabled <String>] [-Secondaries <Int32>] [-TimeToLive <Int64>]

[code]...

Since I don't want my sessions to be removed unless the session has been abandoned either via code or Session Timeout...For eviction, I would think "None" and for expireable, I would think False.I have tested and calling Session.Abandon does remove the object from the cache. I have also tested to see if by extending my session, the session object in cache is also extended. This does seem to work the "correct" way.

View 1 Replies

Data Cache Support Background Population Of Cache Entries?

Aug 1, 2010

We have a data driven ASP.NET website which has been written using the standard pattern for data caching (adapted here from MSDN):

public DataTable GetData()
{
string key = "DataTable";
object item = Cache[key] as DataTable;

[code]...

The trouble with this is that the call to GetDataFromSQL() is expensive and the use of the site is fairly high. So every five minutes, when the cache drops, the site becomes very 'sticky' while a lot of requests are waiting for the new data to be retrieved.

What we really want to happen is for the old data to remain current while new data is periodically reloaded in the background. (The fact that someone might therefore see data that is six minutes old isn't a big issue - the data isn't that time sensitive). This is something that I can write myself, but it would be useful to know if any alternative caching engines (I know names like Velocity, memcache) support this kind of scenario. Or am I missing some obvious trick with the standard ASP.NET data cache?

View 3 Replies

C# - Maximum Length Of Cache Keys In HttpRuntime.Cache Object?

Feb 24, 2010

We are using HttpRuntime.Cache API in an ASP.NET to cache data retrieved from a database.

For this particular application, our database queries feature a LOT of parameters, so our cache keys look something like this:

table=table1;param1=somevalue1;param2=somevalue2;param3=somevalue3;param4=somevalue4;param5=somevalue5;param6=somevalue6... etc...

we have so many parameters that the cache key is several hundred characters long. is there a limit to the length of these cache keys? Internally, it is using a dictionary, so theoretically the lookup time should be constant. However, I wonder if we have potential to run into some performance/memory problem.

View 1 Replies

ADO.NET :: Use HttpContext.Current.Cache (system.web) For Cache Data Something In Project

Sep 13, 2010

I have use Nhibernate in my MVC Project by me known, Nhibernate have cache on Session and Object. now, I want use HttpContext.Current.Cache (system.web) for cache data something in project. my code same that have problem, haven't it. and that's right or wrong.

View 2 Replies

C# - Application_End() Cannot Access Cache Through HttpContext.Current.Cache

Dec 12, 2010

I want to be able to maintain certain objects between application restarts.

To do that, I want to write specific cached items out to disk in Global.asax Application_End() function and re-load them back on Application_Start().

I currently have a cache helper class, which uses the following method to return the cached value:

return HttpContext.Current.Cache[key];

Problem: during Application_End(), HttpContext.Current is null since there is no web request (it's an automated cleanup procedure) - therefore, I cannot access .Cache[] to retrieve any of the items to save to disk.

Question: how can I access the cache items during Application_End()?

View 4 Replies

C# - Web Application Cache Versus Database Cache

Jan 14, 2010

Im building a image gallery which reads file from disk, create thumbnails on the fly and present them to the user. This works good, except the processing takes a bit time.

I then decided to cache the processed images using the ASP .NET Application Cache. When a image is processed I add the byte[] stream to the cache. As far as I know this is beeing saved into the system memory. And this is working perfect, the loading of the page is much faster.

My question is if there are thousands of images which gets cached in the Application Cache, will that affect the server performance in any way?

View 3 Replies

C# - Invalidating The HTTP Cache On Read Only Front Servers?

Mar 24, 2010

We have a CMS system and in the production mode a number of servers only have read-only access to the content (with a few exceptions) and the editors for the site work on the content on servers behind it (which are not available to the public).

We're caching the content quite a long time on the front servers, but sometimes we want the content the editors publish to be available for visitors instantly. What is best practice for invalidating the cache in those cases?

View 2 Replies

Possible To Cache The Response Of A Http Handler On The Server And On The Client

Mar 11, 2010

Is it possible to cache the response of a http handler on the server and on the client?This doesn't seem to be doing the trick:

_context.Response.Cache.SetCacheability(HttpCacheability.Public);
_context.Response.Cache.SetExpires(DateTime.Now.AddDays(7));

View 2 Replies

C# - Cache-Control HTTP Header Does Work Properly?

Mar 22, 2011

I am having issue with cache-control. I have one IIS website with multiple host headers. When you browse site number 1 then cache will be set for this site, when you open browser again and go to 2nd site you will see content from first site. How can I determine cache content based on the site user visits? Everything working fine when you have 1 site and host header related to SAME site.

//Set Cacheability
if (!Context.User.Identity.IsAuthenticated && _activeNode.CacheDuration > 0)
{
var eTag = GetETag(_activeNode);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Public);

[Code]....

View 1 Replies

Architecture :: Handle BL Cache For Multiple Web Applications?

Mar 27, 2010

I recently received a project that contains multiple web applications with no MVC structure. For starters I've created a library (DLL) that will contain the main Business Logic. The problem is with Caching - If I use the current web context cache object than I might end up with duplicate caching (as the web context will be different for every application).

I'm currently thinking about implementing a simple caching mechanism with a singleton pattern that will allow the different web sites (aka different application domains) to share their "caching wisdom". I'd like to know what is the best way to solve this problem.

View 3 Replies

Http - FireFox 3.6.8 Not Cache Static Contents From .net Developer Server?

Aug 19, 2010

I am working on a asp.net web site, like normal user, we use asp.net developer server during coding and testing.Today, I found the firefox not cache any static file of my site, since our application is pretty big, it made page load time very slow.I checked firefox about:cache, all the static file cache setting looks like

Key: http://localhost:26851/App_Layout/icons/actions/email/folder.png
Data size: 871 bytes
Fetch count: 1[code]...

The expires date is set back to 1969-12-31, I believe that's the reason why they are loaded very time.I am using Visual studio 2008, windows 7 machine. The application works fine in IE, the contents are properly cached.

View 5 Replies

Caching - What Techniques Should Be Used To Handle Objects In Asp.net Cache To Prevent Problems From Multiple Worker Threads Access

Sep 8, 2010

since asp.net contains multiple threads that are executing at the same time.so if 2 threads access an object (simple or complex) that i got from the the asp.net httpcontext Cache.can't this lead to state problems on that object if these 2 theads tried to modify/read it at the same time?so what kind of precautions should i implement?for example i am thinking maybe locking the object while working with it? (wont this cause performance problems?)or maybe when i retrieve some object from the cache i should create a copy from it?
or maybe i dont need to worry about this issue at all?

View 2 Replies

Sql - Cache And Output Cache For Controls?

Oct 28, 2010

You know I have the way to Cache the data I've got from the SQL Server over data caching. In addition I can output cache web user controls.Whats about a web user control contains data from a SQL database? Does it make sense to cache the data and also cache the control?What is the best solution for the combination of these two components?

View 1 Replies

Architecture :: Asynchronous Page Processing In 3 Tier Architecture?

Jul 30, 2010

I am working on 3 tier architecture: UI, BL, DAL. In my UI i have following code for Asynchronous page processing:

[Code]....

But I want a database fetch operation to be performed in this asyncronous method. And due to 3 tier arch. i am unable to do this in UI Layer. Can anyone guide me that how can I implement Asynchronous processing in 3 tier architecture? Note: If you are going to place EndAsyncWork1 in DAL then show that how can I return a value back to UI layer from this function.

[Code]....

View 1 Replies







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