-1

I have a virtual directory on IIS7.5, it has .mp4 files.

I want to enable caching at folder level, so that videos can play without buffering. Can the following "web.config" be used? I want to place the "Web.config" inside the folder.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="01:00:00" />
    </staticContent>
  </system.webServer>
</configuration>

I also do want to limit the cache to 1GB, how do I achieve this?

One Developer
  • 99
  • 5
  • 43
  • 103

2 Answers2

1

This might help you:

<configuration> 
 <location path="showStockPrice.asp">     
   <system.webserver>        
     <caching>         
       <profiles>
         <add varybyquerystring="*"location="Any"
           duration="00:00:01" policy="CacheForTimePeriod"            
           extension=".asp">
       </profiles>
     </caching>
   </system.webserver>
 </location> 
</configuration>

More details here and here.

0
<configuration>
  <system.web>
    <httpRuntime maxRequestLength="1048576" />
  </system.web>
</configuration>

1048576 = 1024 Mb You can read this post: windows server 2008 IIS 7.5 maximum file accept limit

<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
            <mimeMap fileExtension=".m4v" mimeType="video/m4v" />
     </staticContent>
    </system.webServer>
</configuration> 

Read this article, maybe it can help you. https://blogs.iis.net/bills/how-to-add-mime-types-with-iis7-web-config

Yordan
  • 88
  • 6