Changes on my website are not shown until pressing F5

0

I'm designing my website. I have it programmed with php and mysql.

My problem is that when I publish it on the host, the queries do not show the changes until I reload the page.

This seems to be the problem of the host that you hire because in my localhost it updates at the moment without needing to press F5 .

I was checking the .htaccess but it is blank, it does not have any instructions to be cached or something similar.

Extra data: the host that presents me with the problem is link

    
asked by Luis Manuel Romo Garcia 22.05.2017 в 09:45
source

1 answer

1

In the php where you generate the result of the query you can force the caches not to act with the following php commands

header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);

Being header commands should be executed before you send with echos, prints, ... nothing to the browser.

    
answered by 22.05.2017 в 10:00