Brendan Enrick

Daily Software Development

Caching made easier with a cache manager

   I recently added caching to my Content Management System. Since I am no caching expert I wanted to make sure I had created the functionality that I wanted to make. I wanted to ensure durations were as I expected, and wanted to make sure that items were cached when they should be and removed when they shouldn’t be cached anymore. I could have changed the program to debugging mode and debugged the code. I could also have added code to check and see the values of the cache object at certain times, but I found a much easier solution.

   I found that by adding this Cache Manager plug-in to my site I was able to quickly and easily check at any moment what was in the cache. All it took to add this to my site was copying this file into my bin folder, and copying a line of code into my web.config file. Since I was just using this while debugging the application there was no need to worry about the optional security on the cache manager. When I was done setting up the caching, I simply removed the dll file and the line of code from my web.config file.

   I recommend checking out that cool little plug-in if you are doing any work with caching. I plan to use that tool any time I am working with caching on any ASP.NET web site. I like things that make my job easier.

Simple CMS

    Lately I have been working on a simple content management system. This CMS will not be like a lot of what is currently available. The software applications that currently exist tend to be applications which are the site. Simple CMS will plug into an existing web page. This is beneficial because it will allow people who have one or more web sites to quickly and easily add content to that site.

    So far I have been able to keep the install down to one executed SQL script, a dll file, and some copying and pasting into a web.config. This may be changing a bit as I add more to the functionality of the system.

    I have been working with the httphandlerfactory class. I have my SimpleCms handler factory inherit from that class, and I use to handle the content which the system creates. Creating these pages often gets complicated, because I have to find ways to get the controls to render correctly. Sometimes I cannot use the controls I want to use because I cannot get them to render. I am working still to get them working, but for the time being I want to have a working CMS.

    Inheriting from System.Web.UI.Page, I create my base pages for the system, and from there I have a couple of custom administrative pages built into the system. This is the interface which users connect to to manage the content. Since these pages are classes the user is able to change the location with which to connect to them.

    Soon I will be passing this assembly to Zach Bussinger, who is going to try to implement and use this. I like to think that he is a test subject or guinea pig. If he can't get it working I think I need to go back to the drawing board, but if he can then it should be usable. He will also probably let me know what kinds of problems he finds in the application that I did not notice.

    Once I have a version of the application to release I will make sure to blog more about it. I will probably talk more about how to use it and its features when I am farther along with the project.