0

I have an that uses Twilio and this app has 2 very different sets of audio files:

  1. Menus (files never change)
  2. Information (files change constantly)

At the moment I had to set all the cache for my files of as I couldn't figure out how to set a different expiration date before send the file to twilio, the problem been that twilio download the files directly from the website, so as far I as understand I cannot set the cache using ASP.net

I am using the xml below in the web.config in the directory where my files are at the moment but I cannot find a way to specify different values to different files, for example:

  • menu1.wav - max cache
  • meny2.wav - max cache
  • info1.wav - no cache
  • info2.wav - no cache

Is it even possible?

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
      <system.webServer>
          <staticContent>
              <clientCache cacheControlMode="DisableCache" />
          </staticContent>
      </system.webServer>
</configuration>
Icaro
  • 14,585
  • 6
  • 60
  • 75

1 Answers1

0

Twilio evangelist here.

Looks like you can use the <location> element to define different folders that have different cache policys on them:

How to configure static content cache per folder and extension in IIS7?

Hope that helps.

Community
  • 1
  • 1
Devin Rader
  • 10,260
  • 1
  • 20
  • 32
  • I was trying to avoid this approach as it will require a lot of changes in the code, I am trying to find a way where I can set the cache for the file as it is requested like I can do for the normal pages. – Icaro Jun 01 '15 at 01:19