0

So, I'm learning about caching...

I'm building a function to compress and cache JS files.

I'm trying to make it update any time I change a file though, to do this, I am trying to compare the lastWrite time of the JS files on my server and the time that the cache file was written.

So, adding the data to the cache looks like this:

HttpContext.Current.Cache.Insert("cachedJS", FileJS, Nothing, DateTime.Now.AddMinutes(1200), TimeSpan.Zero)

And I can retrieve this data easily enough, but, how do I determine the lastWriteTime of the CACHE key?

1 Answer 1

0

You can develop extension methhod InsertWithLog and use this method to insert item in your cache, and trace the time of insertion, but it's not possible to realize this work without customization.

Here all avaiable format of Insert :http://msdn.microsoft.com/en-us/library/system.web.caching.cache.insert%28v=vs.71%29.aspx

1
  • Ah, OK, that'll be why I can't find anything on Google about it! I'll just add a dateTime key to compare. Aug 28, 2012 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.