Try our conversational search powered by Generative AI!

Created file in VPP always returns old one


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?

Oct 30, 2013 11:16

Not sure if it would help, but have you tried setting staticFile expirationTime for the specific VPP where your file is located? E.g. 

    <location path="Documents">
                   <add path="*" verb="GET,HEAD" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true"/>      
      <staticFile expirationTime="-1.0:0:0" />


Also is your expirationTime format correct? (0:0:0)

Oct 30, 2013 12:13

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">...


Oct 30, 2013 13:54

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">
        <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="true"/>
        <add path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer" validate="true"/>
      <validation validateIntegratedModeConfiguration="false"/>
        <add name="webresources" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader"/>
        <add name="wildcard" path="*" verb="*" type="EPiServer.Web.StaticFileHandler, EPiServer"/>
    <staticFile expirationTime="-1.0:0:0" />


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 :-/

Oct 30, 2013 14:26

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.

Oct 30, 2013 16:05

Good stuff.

Oct 30, 2013 18:32
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.