Can Share HttpRuntime.Cache Between Applications
Aug 15, 2010
I have a website setup like this:
/Web --this is the client facing site /Web/Admin --this is the backend system and is setup as a Virtual Application
I'm using HttpRuntime.Cache for caching calls to the database. What I want to be able to do is clear something that is cached on the /Web site from the /Web/Admin site. It appears though that HttpRuntime.Cache is a single instance per application.
View 2 Replies
Similar Messages:
Nov 10, 2010
We have a web application that is storiing all site data in HttpRuntime.Cache. We now need to deploy the application across 2 load balanced web servers. This being the case, each web server will have its own cache, which is not ideal because if a user requests data from webserver1 it will be cached, but there next request might go to webserver2, and the data that their previous request cached won't be available. Is it possible to use a shared-cache provider to share the HttpRuntime.Cache between the two web servers or to replecate the cache between them, so that the same cache will be available on both web servers?
View 4 Replies
Oct 27, 2010
I have one website over at utopiapimp.com. The website is used for a popular web based game. Some company internets don't allow the website to be accessed so I opened up another domain at utopiashrimp.com. Same website but a different iss application. Both have same database backends. They also both sit on the same virtual machine. I put my brand new code on shrimp and solve bugs with that code. I host the solid code on pimp. So I can't just forward the shrimp domain to pimp because I need a test bed.
The problem is that they don't share the same application cache. So my question is, can two websites share the same application cache? I really need to figure this out. I would rather not create a webservice and or a handler that one website needs to hit to change the cache on the other application.
View 2 Replies
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
Mar 27, 2011
I have a SharePoint 2010 Farm and want to use object caching for my own custom objects.
Since it's an ASP.net Application at it's core, I could use HttpRuntime.Cache. On the other hand, SharePoint 2010 offers it's own SPCache.
Why would I choose SPCache over the HttpRuntime.Cache one?
View 2 Replies
Apr 22, 2010
I am new in Asp.net MVC but i really like it. I always prefer flexible authentication systems, on the other hand security is very important issue too. So i looked for some sipmle way to store current loged "user id/user name" in server side. I think that "HttpRuntime.Cache" can be a answer. So i write simple test project Of course this code is is not complete.
[Code]....
View 6 Replies
Jan 29, 2010
what the default serialization used by the ASP.net HttpRuntime.Cache is? Is it Binary, XML, something else?
I am populating a generic List with multiple objects of the same custom type. The custom type is a POCO, there is nothing special about it. All of its properties are public with { get; set; }, it is public, it has no inheritance, it has no interfaces. In fact it is much less complicated than many other objects which we are caching which work without issue. I have tried adding the [Serializable] attribute to the custom class and it has no effect.
I add the list to the cache with a unique key. The list has been verified as populated before it is inserted into the cache, the objects in the list have been verified as populated as well. But when the list is pulled back out of the cache it is an empty list (NOT NULL), it simply has no items in it. This means that the list is being added to the cache and is retrievable but for some reason the cache is having issues serializing the objects in the list.
I just find this freaky weird since I have another list of custom objects which are much more complicated (consisting of Inheritance, Interfaces, and also containing Properties which are generic lists of other complex objects) and the caching of those lists work without issue.
Both the working and non-working list are being managed in C# classes outside of the ASP.net user controls which consume the cached data. Both of these cache handling classes call the exact same Cache Manager class singleton instance which wraps the HttpRuntime.Cache to provide typed methods for pull and pushing objects into the cache.
Here is the class
[code]....
View 2 Replies
Oct 19, 2010
I've been experimenting with caching objects with HttpRuntime.Cache and I was generally under the impression that if I "added" something to the cache like this:
HttpRuntime.Cache.Insert("Test", "This is a test!", null,
Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, new CacheItemRemovedCallback(FileChanged));
that the "NotRemovable" and "NoExpiration" flags would keep the object in-memory for the duration of the application. But was finding that at the end of certain page requests, the HttpRuntime.Cache would be completely empty!
Tracing thru and setting a breakpoint inside my Callback "FileChanged" I could see that indeed something was "removing" my object (and every other object in the cache), but I couldn't figure out why. So eventually, I started disabling other things that I thought might affect this subsystem.
Eventually, I commented out the line:
WebConfigurationManager.OpenWebConfiguration("~").Save;
I had been mostly retrieving data from "web.config" in the AppSettings region, but occasionally writing back to AppSettings and saving the changes using the above command. I knew from reading that the "web.config" is cached, but saving my changes back to it shouldn't flush all of HttpRuntime.Cache, right?
EDIT:
I've made this super reproducible if wants to try this on their own machine. (I'm running VS2008 Pro w/ MVC2 targeting .NET 3.5) Just start up a new MVC2 project and paste the following into the HomeController over whatever is already there:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Configuration;
using System.Configuration;........
Start-up the app in debug mode. Click on the "About" link. This loads a string into the Cache. Click on the "Home" link. String is pulled from the Cache and stuck in ViewMessage dictionary. Some key/value pair is written to web.config and saved. String from cache should appear on the Home page. Click on the "Home" link again. String should be pulled from the cache, but it's not. Stop program. Comment out the 3 lines that start with "Config". Restart the program. Try steps 1 thru 4 again. Notice how the HttpRuntime.Cache has not been emptied.
View 1 Replies
Nov 12, 2010
My servers are behind F5 load balancer, I wanna use HttpRuntime.Cache in my web application but I didn't find out the way for to use that method for those using network load balancing server. Or can we store that HttpRuntime.Cache to sql server like the session we do in web.config file?
View 4 Replies
Nov 19, 2010
I am trying to remove the cache using the HttpRuntime.Cache.Remove(key) but invain. I wonder what are the best practices for using HttpRuntime.Cache.
View 2 Replies
Sep 22, 2010
im about to wirte an app that is an extension from the main application that is hosted on the IIS. My application is going to work as a child app (main app as parent) working in main application pool. User will be redirected from the menu to main app to my website. And here is my problem. I would like to pass informations like user login, login state etc. I cant do it via Query String - that wouldnt be safe. I thought I could pass it via Session state, since the SessionID is the same both sides but I cannot retrives parameters on my website(theyre null).
View 2 Replies
Jan 9, 2010
Is there a way that I can share membership (login, etc.) between two different web applications? I would like to create a smaller debug application to test some stuff in my database.
View 2 Replies
Feb 11, 2011
I recall some way to use a single instance of the the asp.net membership for multiple applications. For example...if I have a main single sign on portal, perhaps I'd like them to have access to Application A, B and F, but not C, D & E. Instead of maintaining different security for each application, can we have a single membership table maintaining all of the enterprise applications? So user 'John Doe' would have a single membership record, but have access to different applications.
View 3 Replies
Jan 27, 2011
I'm looking into building a web application platform which users will log into and be able to access other applications based on permissions. I've set up the membership provider and it is being shared between apps. Here is my problem: If I log into application A, and click on a link that takes me to application B, I have to log in again. Is there any way to share that session between applications so the user can log in once, and not have to do it every time they access a different application?
View 6 Replies
Jul 20, 2010
I have a solution with more than one ASP.NET web-application. Every application has its own virtual directory on the same IIS. One application is calling aspx pages in the other applications. How can I share some information (e.g. user/password) between these applications. Is the only way using querystrings (in this case, I must encrypt the information).
View 2 Replies
Nov 6, 2010
I have a bunch of applications that currently share the authentication cookie in v3.5.
We're in the process of upgrading to 4.0 and also upgrading the applications as a whole. I have 1 done, and would love to deploy it. However, as soon as I do, I lose my sharing of authentication cookie in that application.
In each web.config, my machine key is declared. I removed the actual keys to protect the innocent. :)
<machineKey validationKey="..." decryptionKey="..." validation="SHA1"/>
<authentication mode="Forms">
<!-- DEV Server -->
<forms enableCrossAppRedirects="true" loginUrl="Logon.aspx" name=".COOKIENAMEHERE" protection="All" path="/" slidingExpiration="true" timeout="1440"/>
</authentication>
View 1 Replies
Mar 19, 2010
I would like to create a web application that gives an overview of all latests builds of a Team Foundation Server (TFS). The original idea was to simply query the TFS for all these builds and display the results using html. Now the problem is that this is just too slow. It takes around a minute to get the required informtion. I can't inluence this, it is just given. So I came up with the idea of caching. I could cache all results for a certain period of time and then invalidate the cache but as soon as the cache expires someone that uses the application will have to wait again which is not that nice.
The Team Foundation Server is able to notify whenever a new build is available. So basically the idea is that the application could react on that notification. In order to be notified I have to write a web service and register it with the TFS. That worked pretty well so far. The web service is now notified whenever a new build is done. Now I would like to connect my web application to the web service and whenever the web service is notified by the TFS update the cache of the web application. Here starts the problem. How can this be achieved? First I thought that the web service could fire a .NET event and the web application could react on that event but that does not seem to be possible. The next idea was that both the web service and the web application could use the same cache. The web service could then directly update the cache with the build information it receives from the Team Foundation Server but I am not even sure if this works.
Can a web service and a web application share the same cache? The web service doing something like Cache.Add("key", buildInfo) and the web application buildInfo = Cache["key"]. If not what other approach could be used to solve such a scenario?
View 4 Replies
Mar 5, 2011
I am trying to integrate an existing asp.net application with sharepoint 2010. I would like to be able to have a logged in user on the application access a document library via an Iframe on the sharepoint 2010 site. I want to use FBA on sharepoint. Is it possible to share the membership database from the asp.net application with sharepoint? If not, what would be the best way to accomplish this?
View 1 Replies
Aug 13, 2010
Is it possible to share the claims based authentication of a logged in Sharepoint 2010 user with a separate Asp.net application?
The following article describes how it was done using Sharepoint 2007 and forms authentication through forms auth and sharing machine keys etc however I cannot find any information regarding the external application consuming the claims authentication that is now used in Sharepoint 2010?
View 2 Replies
Nov 11, 2010
We are developing a framework which will be shared accross applications. What is the best way to share master pages, user controls accross applications by preventing other developers to modify the master pages and the user controls ?
Is the following way suitable one ? Embedding masterpages and the user controls in a dll and using VirtualPathProvider to load the master pages and user controls dynamically.
But in this approach developers can not view the design. Is there any other way to convert master pages and user controls to a different format as developers can able to view design?
View 2 Replies
Apr 8, 2010
I need to invalidate cache in a web application when related data is updated in another application (running on the same machine). Both applications use the same database. I know there's SqlCacheDependency. How do is it in terms of performance? Is interprocess communication (e.g. using name pipes) an option in web applications? Does it outperform SqlCacheDependency?
View 2 Replies
Jul 30, 2010
Is it possible to share a cache between multiple ASP.NET applications? The apps may reside on different servers. How can one achieve this requirement?
View 1 Replies
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
Jul 7, 2010
I have an asp.net solution in which there are two web application projects (client website and admin website) and also a class liabrary project in the same solution . In the live production server, the admin web app is within the client app (eg: client site= [URL] and admin site=[URL]). A class (with static variables) in class liabrary is userd to cache data. My problem is that i cannot get the changes to the static cache by one web project reflected to the other (becoz, i think, they seem to load in seperate appdomains).
View 3 Replies
Jun 10, 2010
I need a code to have the ability to share my news on social networks.My site structure is in Asp.net and vb.net.
View 1 Replies