Encuentra cuándo se agregó un elemento a un caché
Frecuentes
Visto 40 veces
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 Respuestas
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
Respondido 28 ago 12, 13:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas asp.net caching outputcache or haz tu propia pregunta.
Ah, OK, that'll be why I can't find anything on Google about it! I'll just add a dateTime key to compare. - jamie hartnoll