I have a web application:
W3SVC/1/ROOT/MyApp
I can set the HttpExpires value via adsutil:
cscript C:\InetPub\AdminScripts\adsutil.vbs set W3SVC/1/ROOT/MyApp/HttpExpires "D,86400"
However, I don't want caching for the whole application, just my images which is a subdirectory:
W3SVC/1/ROOT/MyApp/images
Keep in mind that images isn't it's a web directory, just a sub-directory.
When I try thru adsutil I get this:
The path requested could not be found. ErrNumber: -2147024893 (0x80070003) Error Trying To Get the Object: W3SVC/1/ROOT/MyApp/images
I was under the impression that creating a web directory would create a virtual directory,but when I look at the metabase it is set as a web directory;so,
Set vDir = GetObject("IIS://LocalHost/w3svc/1/root/myapp")
If err.number <> 0 Then
Set objRoot = GetObject("IIS://LocalHost/w3svc/1/root/myapp")
Set vDir = objRoot.Create("IIsWebDirectory", "images")
End If
vDir.Put "HTTPEXPIRES", "D,2419200"
vDir.SetInfo
User contributions licensed under CC BY-SA 3.0