Not sure if it would help, but have you tried setting staticFile expirationTime for the specific VPP where your file is located? E.g.
<configuration>
...
<location path="Documents">
<system.web>
<httpHandlers>
<add path="*" verb="GET,HEAD" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true"/>
<httpHandlers>
</system.web>
<staticFile expirationTime="-1.0:0:0" />
</location>
</configuration>
Also is your expirationTime format correct? (0:0:0)
Actually that was the idea I am going to try now.
The -1 in "-1.0:0:0" is amount of days, correct? Like days.hours:minutes:seconds
I actually have one file in 3 different folders, so I guess I need to do this on each of that folder like:
<location path"Global/folder01">....
<location path"Global/folder02">...
That's correct. See http://labs.episerver.com/en/Blogs/Per/Archive/2008/4/Performance-tweak-Optimizing-StaticFileHandler-in-EPiServer-CMS-5/
Unfortunately it didn't work?!
Tried different string defined in path of location, even like below to exactly point to the file and copy content of how the location is written for folder "Global", and only changed expirationTime.
<location path="Global/myfolder/mysubfolder/myfile.xml">
<system.web>
<httpHandlers>
<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true"/>
<add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true"/>
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader"/>
<add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer"/>
</handlers>
</system.webServer>
<staticFile expirationTime="-1.0:0:0" />
</location>
The only time I get correct content of the file is if I save it under a new filename - which is not a solution for me :-/
It works now. A combination of that I also needed to do hard refresh in the browser made me confused about what the real problem really was. The location settings did the trick.
I create an XML-file programatically in a VPP folder.
When I open it from inside EPiServer edit mode, it always returns the old content of it, even though the datetime stamp is showing that the file is updated?!
If I delete file first and then recreate it, it still returns old content of the file?!
Only if I save the file with a new filename then the correct content of the file is returned correctly! But I need to keep same filename, I just want to overwrite it or delete it first and then recreate it with same filename.
I guess it might have something to do with caching, so I tried to change staticFile expirationTime in Web.config to zero or minus value, but it didn't help.
Any suggestions?