Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Cache, TinyMCE and the Case of the massive imagelist Cache, TinyMCE and the Case of the massive imagelist
Previous
 
Next
New Post
2/19/2007 2:30 PM
 

Hi guys,

I was wondering if someone could please help me with a cache related problem. We use TinyMCE image manager on our portal and have integrated a function which builds an image list within the image control box. The image building is a lengthy task and is completed inside its own project. I use the DataCache object to cache the list inside the project and then the Http cache to store the list within the website. Here is the function that handles the image rebuild (it’s outside of the website):

 

        Public Function GetTinyMceCache(ByVal pid As Integer) As String

            Dim tmpC As System.Web.Caching.Cache = HttpContext.Current.Cache

            strCache = DataCache.GetCache(ImageListDataCacheKey)

' Firstly, we need to check if the folder/image list is in the cache and that we r not doing a specific rebuild

If strCache Is Nothing Then

                BuildTinyMceCache(pid)

            End If

            Try

                Return strCache.ToString

                'Return DataCache.GetCache(ImageListDataCacheKey).ToString

            Catch ex As Exception

                Dim msg = String.Format("Failed to Get Tiny MCE Image List: ", ex.Message)

                Return msg

            End Try

        End Function

The calling function within the website simple checks to see whether the list is within the Http cache and if not, calls this function. I have successfully been able to cache the imagelist on my local machine but when I put the code live, the list is only added momentarily and then kicked out. The list size is significant (1.3 Mb) which I think to be the problem. When I cut down the list on the list site, I was able to successfully add the list to the cache. Also, when I checked the limit on the http cache, we were well below that.

Can anyone suggest a method by which I can increase the size limit on the http cache element? Ort how I could successfully cache this sort of list. 

Any help with this problem would be much appreciated!

Paul

 
New Post
2/20/2007 10:56 AM
 

You are probably correct - it is the memory size that is the issue.

Asp.NET will scavenge the cache for items to remove - I have found (empirically) that if the "consumed" memory is > 60% of the free memory, the cache will be scavenged.

Now while 1.3MB is not large on your local machine - it might be on a shared hosting environment with multiple websites competing for the same cache memory space.


Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
2/21/2007 12:18 AM
 
Hi Charles,
Thanks for your reply. I was wondering if you or anyone else reading knows how I might go about reserving space in the cache or forcing some sort of expiration date. The cache is booted from the server almost as soon as it is added which is not acceptable. Is storing the data in the db probably the best idea? Currently the list takes around 2 mins to build so I assume that retrieving the 1.3 mb list from the db (as apposed to rebuilding the list and then retrieving the text file) would result in some sort of performance gain.
If anyone else out there has faced similar issues with the asp.net cache, I would warmly welcome any thoughts.
Regards,
Paul
 
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Cache, TinyMCE and the Case of the massive imagelist Cache, TinyMCE and the Case of the massive imagelist


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out