This is a migrated thread and some comments may be shown as answers.

2nd Level Cache - how to share between applications

2 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
kzimny
Top achievements
Rank 1
kzimny asked on 08 Nov 2015, 10:02 PM
Is there another way beside MSMQ to share 2nd Level Cache between two applications hosted on the same web server?
In my scenario there are two virtual directories located in the same application Domain:

mydomain.com is the root folder and the virtual directories are mydomain.com/ApplicationA (for WebForms) and mydomain.com/ApplicationB (for MVC).

Both virtual directories share the same HttpContext and have the same application pool. MSMQ can not be used due to the shared hosting environment.
How to synchronize the 2nd Level Cache between both applications if data changed in one of the application?

2 Answers, 1 is accepted

Sort by
0
Accepted
Thomas
Telerik team
answered on 11 Nov 2015, 03:41 PM
Hi Krzysztof,


I've put together a git  project under

https://github.com/tkcode123/CustomSecondLevelCacheCluster

that shows how to implement a custom second level cache cluster eviction mechanism with TCP or RDP.
This solution provides you with a starting point for your own implementations.
There will be
no official support for this project from Telerik/Progress.

I kindly ask you to contribute changes/improvements back so that other customers could benefit from it. (The license does not require this.) 


Regards,
Thomas
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.

 
0
kzimny
Top achievements
Rank 1
answered on 12 Nov 2015, 03:05 PM

Hi Thomas,

thank you so much for the link! Your implementation for sharing 2nd Level Cache between applications works perfect in my shared hosting enviroment. I extended the CustomizeBackendConfiguration class with partial class DbContect.partial.cs class as follow:

 

public partial class DbContext
{
    protected override void OnDatabaseOpen(Telerik.OpenAccess.BackendConfiguration backendConfiguration,
        Telerik.OpenAccess.Metadata.MetadataContainer metadataContainer)
    {
        string sName = typeof(CustomSecondLevelCacheClusterTransport.UdpMulticastClusterTransport).AssemblyQualifiedName;
        backendConfiguration.SecondLevelCache.Enabled = true;
        backendConfiguration.SecondLevelCache.Synchronization.Enabled = true;
        backendConfiguration.SecondLevelCache.Synchronization.Name = sName;
        backendConfiguration.SecondLevelCache.Synchronization.Localpath = "MickeyMouse";
    }
}

 

UDP multicast implementation seems to work in (our) shared hosting enviroment.

Regards,

Christopher

 

Tags
General Discussions
Asked by
kzimny
Top achievements
Rank 1
Answers by
Thomas
Telerik team
kzimny
Top achievements
Rank 1
Share this question
or