jahlxx Posted October 17, 2016 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. Quote
Sherzod Posted October 17, 2016 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 Quote
maniraj.baral@globant.com Posted June 13, 2018 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 Quote
jahlxx Posted September 30, 2019 Author 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. Quote
Sherzod Posted September 30, 2019 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? Quote
jahlxx Posted September 30, 2019 Author 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 Quote
Sherzod Posted September 30, 2019 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. Quote
jahlxx Posted September 30, 2019 Author 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 Quote
jahlxx Posted October 2, 2019 Author Posted October 2, 2019 Hi. Have you seen the test case? Thanks. Quote
Sherzod Posted October 2, 2019 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; Quote
Botch Posted October 5, 2021 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); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.