jahlxx Posted October 17, 2016 Share Posted October 17, 2016 Hi. Is there any way to not use the browser cache?. I have a help files in html, loaded in a uniurlframe. when I change one help file, the users can't view the new version, until not clear the browser cache. thanks. Link to comment Share on other sites More sharing options...
Sherzod Posted October 17, 2016 Share Posted October 17, 2016 I have a help files in html, loaded in a uniurlframe. when I change one help file, the users can't view the new version, until not clear the browser cache. Hi, Can you try this?!: for example: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniURLFrame1.URL := 'files/test.html?' + FormatDateTime('ddmmyyyyhhmmss', Now) end; Best regards. 2 Link to comment Share on other sites More sharing options...
jahlxx Posted October 17, 2016 Author Share Posted October 17, 2016 jajaja. ok. good trick. thanks. Link to comment Share on other sites More sharing options...
maniraj.baral@globant.com Posted June 13, 2018 Share Posted June 13, 2018 Hi, Can you try this?!: for example: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniURLFrame1.URL := 'files/test.html?' + FormatDateTime('ddmmyyyyhhmmss', Now) end; Best regards. I just tried it and works fine 1 Link to comment Share on other sites More sharing options...
jahlxx Posted September 30, 2019 Author Share Posted September 30, 2019 Hi. When the link is from other html file, don't work. I mean that I show a html page in a urlframe. In that page, there is a link to other html page, but allways shows the same, not the modifications until clear the cache. Link to comment Share on other sites More sharing options...
Sherzod Posted September 30, 2019 Share Posted September 30, 2019 7 minutes ago, jahlxx said: When the link is from other html file, don't work. I mean that I show a html page in a urlframe. In that page, there is a link to other html page, but allways shows the same, not the modifications until clear the cache. Hi, How can we reproduce? Link to comment Share on other sites More sharing options...
jahlxx Posted September 30, 2019 Author Share Posted September 30, 2019 ok. just open index2.html in a urlframe. then click to link TEST. after that, try to modify the other html file, and you will see allways the older version. index2.html mainform.html Link to comment Share on other sites More sharing options...
Sherzod Posted September 30, 2019 Share Posted September 30, 2019 1 hour ago, jahlxx said: just open index2.html in a urlframe. then click to link TEST. after that, try to modify the other html file, and you will see allways the older version. Sorry, can you please make a complete test case for test? Thanks. Link to comment Share on other sites More sharing options...
jahlxx Posted September 30, 2019 Author Share Posted September 30, 2019 Here it is. Press button, and it will load index.html. Inside index.html, click, test link, and will load second.html. Exit application. Modify second html. Run application again, press button and click the link, and you will see that open the older second.html. I hope this help. Thanks. test.zip Link to comment Share on other sites More sharing options...
jahlxx Posted October 2, 2019 Author Share Posted October 2, 2019 Hi. Have you seen the test case? Thanks. Link to comment Share on other sites More sharing options...
Sherzod Posted October 2, 2019 Share Posted October 2, 2019 56 minutes ago, jahlxx said: Have you seen the test case? Hi, Sorry for the late reply. Try to analyze and try to use this approach... procedure TMainForm.htcontFrameLoaded(Sender: TObject); begin UniSession.AddJS( 'try {MainForm.htcont.iframe.contentDocument.querySelector(''a[href*="second.html"]'').href=MainForm.htcont.iframe.contentDocument.querySelector(''a[href*="second.html"]'').href+"?dt="+Date.now()} catch(err){}' ); end; Link to comment Share on other sites More sharing options...
jahlxx Posted October 2, 2019 Author Share Posted October 2, 2019 yes !!!! it works !! Thanks. 1 Link to comment Share on other sites More sharing options...
Botch Posted October 5, 2021 Share Posted October 5, 2021 How to prevent caching of files loaded loaded by list ServerModule.CustomFiles for example files/main.js I can write files/main.js?v1 but I want to automate the process ..... sorry, the decision is obvious procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject); var FileName, Update: string; begin FileName:=FilesFolderPath+'main.js'; Update:=IntToStr(FileAge(FileName)); CustomFiles.Add('app/files/main.js?v'+Update); Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now