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?

Jamie Hartnoll
  • 7,231
  • 13
  • 58
  • 97

1 Answers1

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

Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51