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.0Module Caching 4.4.0 - Does it work?Module Caching 4.4.0 - Does it work?
Previous
 
Next
New Post
1/19/2007 7:22 PM
 

I have replicated this issue using a default install of 4.4.1, removing all modules except the Welcome... module, and running SQL Profiler. Firing up the debugger and walking through PortalModuleBase - CreateChildControls method, I encountered some very strange behavior with the code below:

Dim cacheFile As New FileInfo(CacheFileName)
If cacheFile.CreationTime.AddSeconds(_moduleConfiguration.CacheTime) >= Now Then
...

When I examine the value of the CreationTime for the cacheFile sometimes contains a date/time which is not correct. For example, lets say we have a cacheFile which has a date of Jan 19, 2007 1:00 PM,  our module has a CacheTime of 60 seconds, and the current date/time is Jan 19, 2007 2:00 PM. The code above determines the cacheFile to be "expired" so the code in the CreateChildControls method deletes the file from the file system ( I even verified in File Manager that the file was deleted ). Then the Render method creates a new version of the file ( which I also verified in the File Manager ). However, on the next request, when the debugger hits the code identified above, the CreationTime is still set to Jan 19, 2007 1:00 PM - the date/time value of the old version of the file which was deleted! In File Manager, when I right-click and view the file properties, it also displays a CreationTime of Jan 19, 2007 1:00 PM. So it appears that Windows is caching the CreationTime of the file and when a new file is created with the same name, it uses the cached CreationTime. This obviously leads to some weird behavior. But its not surprising, as we found a similar Windows bug when we were working on the folder synchronization logic ( when a file is replaced with a newer version, the Directory LastModifiedDate attribute is not updated to reflect this change ).

After looking at the other attributes available and confirming their reliability, it appears that we should actually be using the LastWriteTime for the cacheFile - as it appears to always be accurate in terms of its value.

 


My comments are my own and are offered WITHOUT PREJUDICE

Shaun Walker
http://www.siliqon.com
 
New Post
1/20/2007 7:59 AM
 
Do I understand correct that this goes wrong with caching set to disk and that it works when setting the cache to memory?
 
New Post
1/20/2007 2:13 PM
 

Yes Mariette, this issue is just when caching is set to disk - memory caching works fine.

FYI - IMO Disk Caching works well for low-memory scenarios (hosting), but sites that use dedicated servers and do not have a memory issue per se should still use Memory Caching.

Memory Caching is not as scalable as Disk Caching but is faster.


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
1/20/2007 2:18 PM
 
Thanks Charles. I had a look in the code to understand what happens. I finally made to install the source version on a Virtual running Windows XP and VS 2005. I find it very interesting and I think I can learn from it though I learn SQL faster :-) I have already made a lot of queries that I use in Andrews Report Module
 
New Post
1/20/2007 8:23 PM
 
So in a web farm scenario how should we set the caching?  We have ours set to Disk.

Philip Beadle - Employee
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Module Caching 4.4.0 - Does it work?Module Caching 4.4.0 - Does it work?


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