Creating a JavaScript Object Cache

If you have ever wanted an easy way to cache JavaScript objects and data in your client-side code just like you would when using the ASP.Net's Server side cache then read this article.

Monsur Hossain wrote a JavaScript LRU Cache which my partner found while we were searching for a JavaScript caching option.  As I am a big fan of the ASP.Net AJAX framework and the fact that I was extremely impressed with the feature rich cache written by Monsur, which was fashioned after the ASP.Net's cache. I decided to port the code to an ASP.Net AJAX component. 

ASP.Net AJAX extends JavaScript in some amazing ways which are beyond the scope of this article. However, ASP.Net AJAX does provide a framework to approach JavaScript in a more object oriented fashion.  One such feature of the framework is building classes based on the prototype design pattern which is my goal in porting Monsur's code.  You can find more information about the Least Recently Used caching algorithms at Wikipedia.  And if you are not currently using ASP.Net AJAX or have no plan to implement it I invite you to visit Monsur's site for the original implementation to which a link can be found at the end of this article. 

For those of you who do use ASP.Net AJAX and are looking for a JavaScript Object Cache read on as I describe the porting of the original which I call the JSOCache. More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: joseph
Posted on: 8/21/2008 at 10:22 AM
Tags: ,
Categories: Code Example | Web Development
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed