Page 1 of 1

Rantext

Posted: Fri May 29, 2020 6:46 pm
by lesm
HI,
I like the script for its simplicity but unfortunately it doesn't work as expected in my CMS TYPO3 site.
It only displays a text the first time I access the site. Then at each new page rendered the script doesn't displays a new text line. In short the text line displayed never changes unless you manually reload the page.
I call the script from the page template:
<script src="/berandom/rantex.php?type=1"></script>

Any idea?

Re: Rantext

Posted: Sat May 30, 2020 6:29 am
by Klemen
The result is probably cached in the browser.

Try this:

1. open rantex.php in a plain text editor such as Notepad++
2. find

Code: Select all

header("Content-type: text/javascript");
3. below #2 add

Code: Select all

    // Tell browsers not to cache the pages
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
4. save, upload and test (you will need to refresh the page the first time)

Re: Rantext

Posted: Wed Jul 15, 2020 1:21 am
by lesm
Hi Klemen,
Please apologize for being so late. I couldn't modify the script until today cause I was very busy working from home.
You're right the result was cached in the browser. Your suggestion fixed it and now it seems to be working okay, at least in my testing server. Tomorrow I will modify the production server and will let you know if anything goes wrong.
Thank you for your help and best regards.