Asp.net - Using RavenDB As A Persistent Cache

Jul 28, 2010

I have currently have a web application that caches a large amount of data (several hundred thousand entries) in memory for quick lookup and then in SQL Server as a persistent cache. Basically the information consists of geocodes of addresses where the geocode is retrieved via a remote web service which takes time if needed to be called continuously rather than cached.
Would using RavenDB (or other suggestions) be a better way of caching this information in a persistent store in terms of both speed and memory?

View 2 Replies


Similar Messages:

How To Make A Session Persistent

Jun 7, 2010

Is there a way to set a persistent session that would not expire when closing/re-opening a browser. The cookie that is used to store the session_id expires when the browser is closed.

I know we can make the Auth persistent (stay logged in when we close and re-open a browser). In this case, the cookie does NOT expire when the browser is closed

View 1 Replies

How To Create Persistent Cookies

Jun 29, 2010

i am creating cookies with following lines:

HttpCookie userid = new HttpCookie("userid", objUser.id.ToString());
userid.Expires.AddYears(1);
Response.Cookies.Add(userid);

Now How to make it persistent?

Because if I visit the same page again after closing the browser, I'm unable to get it back.

View 3 Replies

How To Create A Non Persistent (in Memory) Http Cookie In C#

Dec 21, 2010

I want my cookie to disappear when the user closes their brower-- I've already set some promising looking properties, but my cookies pop back to live even after closing the entire browser.

HttpCookie cookie = new HttpCookie("mycookie", "abc");
cookie.HttpOnly = true; //Seems to only affect script access
cookie.Secure = true; //Seems to affect only https transport

What property or method call am I missing to achieve an in memory cookie?

View 4 Replies

MVC :: How To Store Persistent-user-session Information's

Aug 8, 2010

i have a list of fields that i would store for all the user session. I thought to create a class, insert the information in it and store the class in the session but i'm not sure this is the best way to do it (performances, etc). I should have a list of these informations that i can display in views, i can delete and i can update. How could i do this?

View 10 Replies

Storing HTML In Db While Avoiding Persistent Xss / Sql Injection?

Nov 29, 2010

I'm building a page in asp.net that will use tiny mce to provide a rich text editor on the page. Tiny mce outputs the rich text as html which I would like to save to a database. Then at a later date, I want to pull the HTML from the database and display it in a page.

I'm concerned about allowing malicious html, js tags into my database that would later be output.

I should html encode/decode etc. to prevent a persistent xss attack and or sql injection attack?

View 4 Replies

WCF / ASMX :: Persistent HTTP - Connection For All Calls To A WS?

Apr 25, 2010

I need to connect to a WebService provided by someone else. This WS (all https) has three methods that are accessible without having logged on:

login, logoff, getVersion . All other methods require that the login-method has been called before. Nothing special unto this point. However, the docs state that I have to make sure that (quote):

"All method calls between login and logoff are to be carried out by means of the same persistent http-connection (key word: http persistent connections or http connection reuse"

I seem to be unable to figure out how that would work - all WS'es I ever utilized were either taking user/pwd combinations in each method call or the login-method returned something like a SessionID which was then used for each subsequent call to a given method (i.e. passed as a parameter). If I call the login-method and subsequently call any method that requires authentication, the call will fail with an exception telling me that I need to log in first.

View 1 Replies

Storing Large Arrays Of Persistent Data?

Oct 16, 2010

I have developed an asp.net application that I developed using visual studio express 2008.

With this application, I have 20 sales items. I can sell 10 of each item each day. Customers can order the items in advance but once an item has more than 10 orders for the day then I can not sell any more of the items for that given day. If a customer tries to order another item after 10 has already been ordered then I must tell them that no further items of that kind are available. So for each day there can be possible 200 orders total (20 items x 10 sales). Customers can order months in advance...

So, my question is what kind of storage device do I use to keep track of this kind of data? Database or application variable or other?

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

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

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

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

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# - 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

How To Save And Use Persistent Information Depending On User Type Login

Jun 11, 2010

Iam building a website and i need to store somehow some informations that i will use in the whole site depending of the user type logged in.

Example:

1) User XPTO logs in

2) Query DataBase to see where he belongs

3) Store those 2 or 3 fields that i will get in Database in a persistent way to use it in the whole site.

Whats the best practices to do this?

View 4 Replies

Membership Provider, Validate User When Logging In Through A Persistent Cookie?

Jun 29, 2010

When a user logs in into my website I have a custom membership provider that overrides ValidateUser and verifies that the user has sufficient rights etc.

However, when implementing a 'remember me' function through the default forms authentication using RememberMeSet, I also want to validate a user on the first request.

Is there some hook I can attach to that triggers when a user logs in with their persistent cookie?

View 3 Replies

Save And Use Persistent Information Depending On User Type Login?

Jun 11, 2010

I´m building a website and i need to store somehow some informations that i will use in the whole site depending of the user type logged in.3) Store those 2 or 3 fields that i will get in Database in a persistent way to use it in the whole site.My question is: Whats the best practices to do this?

View 1 Replies

Security :: Custom Membership Provider And Persistent Cookie Will Not Stick

Nov 12, 2010

i have a custom membership provider and do manual validation of the user when they log in and set a persistent cookie with this bit of code:
FormsAuthentication.RedirectFromLoginPage(this.txtEmail.Text,
this.cbRememberMe.Checked);

The cookie gets set fine. I can tell it has all the data it needs by looking at it in Fiddler once im validated. However coming back to the site im always getting prompted to log in again. I am starting to think the problem isn't how im saving the cookie but that maybe my custom membership isn't acutally looking for this auth cookie again. Or im naming it wrong or something.

Two things

1) My membership provider is custom and NOT added to web.config - it's a .cs file that connects to a CMS back end for the validation and it works fine logging people in and such it just never keeps (or uses) the persistent cookie.

NOTE: the persistence doesn't work anywhere (on my local machine / staging server or live server - Application name is simply "/")

NOTE 2: as an aside we have a google search applicance. Which we baked a 10 year cookie for on this site - we opened up the cookie and used the encrypted string in the google search appliance (this is how you get it to get past logins, etc) and this thing works great- it logs itself in no problem all the time. SO i am a bit lost as to why a user with an almost identical cookie is not getting logged in.

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

How To Add Persistent Dynamic Controls Based On User Input (not On Intial Page Load)

Oct 13, 2010

I am familiar with creating and persisting dynamic controls on the first load of a page and on subsequent postbacks but I am having trouble with the following user initiated scenario...

In my demo I have a placeholder, two buttons and a literal

[code]....

View 1 Replies

State Management :: Unable To Create A Persistent Cookie To Store A Preferred Language On Website

Feb 10, 2011

I try to create a persistent cookie to store a preferred language on our website, but it doesn't work.

So, to isolate the problem, I created a new website, with a blank page and with the code behind bellow. If I click the button, the page post back and I get this:

"Cookies expires: 0001-01-01 00:00:00 value: 10"

[Code]....

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







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