How to clear the server cache in iis

I've got a asp.net web site on windows with rather over the top server side caching of files that never change. Unsurprisingly the files have changed. How do I reset the server side cache? I've see lots of how to do it in code but I don't want to add a new page that will clear the cache unless I have too. An IISreset or a box reset will clear the cache but that's rather drastic. Will an application pool recycle? The app pools are set to terminate after idle time out, that'll probably happen overnight will that clear the cache?

code is:

using WebApi.OutputCache.V2; namespace Foo.Web.API.Controllers { public class BarController : ApiController { [HttpGet] [CacheOutput ServerTimeSpan = 31536000)] public HttpResponseMessage Get(string organisationId, string file) { 

3 Answers

I had to delete the files here. This is all that worked for me.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files

2

Both clear the cache. Recycling an App Pool is just less drastic, as it continues to process already received requests and cycles after that. This can be done under load - never had issues with it.

4

Mysterious caching issue resolved by saving current IIS state and restoring saved state using appcmd utility.

Here's PowerShell script that accomplishes task: (run as admin)

enter image description here

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like