November Happy Hour will be moved to Thursday December 5th.

Created file in VPP always returns old one

Vote:
 

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?

#76635
Oct 30, 2013 11:16
Vote:
 

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)

#76637
Oct 30, 2013 12:13
Vote:
 

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

    

#76642
Oct 30, 2013 13:54
Vote:
 

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

#76645
Oct 30, 2013 14:26
Vote:
 

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.

#76655
Oct 30, 2013 16:05
Vote:
 

Good stuff.

#76660
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.