1

I have an application running in IIS via an ISAPI extension with outputs JSON files based on the input URL (it works with a RESTful interface - the URLs are of the form http://domain/path/to/resource.json).

The application works well but I am unable to get IIS Output Caching working for the files I am generating.

In my web.config I have:

<system.webServer>
    ...
    <caching>
        <profiles>
            <add extension=".json" policy="CacheForTimePeriod" kernelCachePolicy="DontCache" duration="00:00:30" />
        </profiles>
    </caching>
</system.webServer>

I've also tried using * but that doesn't work either.

Any ideas why this would not work? Thanks!

Tom--G
  • 31
  • 1
  • 4

1 Answers1

0

By default, caching is disabled on ISAPI filters, and I don't believe it can be enabled through the GUI. Install the ISAPI filter and enable the caching feature by modifying the <isapiFilters> section of the web.config or by utilizing appcmd.exe.

appcmd.exe Example:

appcmd.exe set config -section:system.webServer/isapiFilters /+"[name='YourJsonIsapi',path='c:\yourpath\YourJsonIsapi.dll',enabled='True',enableCache='True']" /commit:apphost

web.config Example:

<configuration>
   <system.webServer>
      <isapiFilters>
         <filter 
            name="YourJsonIsapi" 
            enabled="true" 
            enableCache="true" 
            path="C:\yourpath\YourJsonIsapi.dll" />
      </isapiFilters>
   </system.webServer>
</configuration>
Doug Luxem
  • 9,612
  • 7
  • 50
  • 80