IIS Cache Policy Settings Graphical Tutorial

  
 

1, because the whole site is only for .html .jpg .png .gif .apk files, and other files are not cached; you can first set the entire site to not cache, set as follows:
a) Open &ldquo ; IIS Information Manager & rdquo;, right click on the properties of the service website “ www.xxx.com & rdquo;, then select “ HTTP headers & ldquo; tab, check & ldquo; enable content expiration & rdquo;, and select “ immediately expire ”, then <; determine & rdquo;, as follows: b) After the above settings, the entire site content will not be cached by the CDN, and then set the cache policy for the .html .jpg .png .gif .apk file type. 2. The cache settings for specific files are as follows: a) If the files with different extensions above are placed separately under a specific directory, and the directory has no files with other extensions, then the entire directory where the extension is located can be set. The time of the cache; the specific method is to expand the directory of the website "a.cc.com" in the "IIS Information Manager", select the directory where the cache time needs to be set, for example, all jpgs are stored in the img directory. Then right click on the directory, select “property & rsquo;, select & rdquo; HTTP header & ldquo; tab; because the entire site has set the cache settings, so open the cache of the directory "HTTP header" The settings are the same as in 1, and then the configuration is modified: Select ” expires after this time period, and set the time to the expired time value, such as 14 days, click “OK"Save, as follows : b) If the file with a specific extension is not uniformly placed in a unique directory, it is mixed with other extension files and placed in a directory. In this case, the configuration is more complicated; in order to avoid file-by-configuration for files with specific extensions, we need to let IIS support the "wildcard", which supports the configuration of "wildcards" as follows: 1) Open “IIS Information Manager, right click on the properties of the service website <; a.cc.com”, select “ Home Directory & rdquo; tab, click on the “ Config & rdquo; button on the tab, the following dialog box appears: 2) Under the "Wildcard Application Mapping (Execution Order)" column, click the "Insert" button and select the C: WINDOWSMicrosoft.NETFrameworkv4.0.30319aspnet_isapi.dll file in the pop-up file selection box, where “C: ” is the system disk, do not check “ confirm whether the file exists & rdquo;, as follows: Two consecutive "definite" & rdquo; button click, complete the IIS wildcard support configuration. 3) Next is to the directory where there is a need to cache the configuration file, first select a file that needs to be cached, right click, select Properties, select “ HTTP header & rdquo; select card, perform the configuration in 2.a) And save; then there is a setting for all files with the same extension under this file directory. In this case, you need to modify the IIS configuration file implementation. 4) IIS configuration file is placed in C: WINDOWSsystem32inetsrvMetaBase.xml (IIS6 settings), use the "Notepad" program to open the above file, if we 3) in the bin directory below the test.jpg cache expiration time Set, then we will find the string “ /bin/test.jpg“, you can find the cache settings of the test.jpg file in the bin directory in the file, in order to make all the jpg files in the bin directory use To set the cache, just change “test.jpg” to ”*.jpg“ and then keep the file. Note that to modify the above file, you need to close “IIS admin Service" in “Services. 5) The file cache settings for other extensions can be repeated for the 3) and 4) operations above.

Copyright © Windows knowledge All Rights Reserved