How do I disable caching of an individual file in IIS 7 using weserver config settings

后端 未结 6 780
独厮守ぢ
独厮守ぢ 2020-12-05 09:22

Is there any way to diable the caching of a single javascript file in my ASP.NET applicaiton without disabling the caching of any other files in the application?

It

6条回答
  •  渐次进展
    2020-12-05 10:11

    I just stumbled across this question; you can use the following to disable the cache on a specific file:

    
      
        
          
            
          
        
      
    
    

    (Note that the path is relative to the web.config file)

    Alternatively, place the single file in a directory on it's own, and give that directory it's own web.config that disables caching for everything in it;

    
      
        
          
            
          
        
      
    
    

    [Both tested on IIS7.5 on Windows 7, but you'll have to confirm that it works OK on Azure]

提交回复
热议问题