0

I do changes in my php-file and refresh the page in browser, changes are applied first, then I do some other changes, refresh again(ctrl+R, many times) and see it UNchanged, like it's cached. About 1-2 min pass(approximatly) and changes do get applied, although I didn't edit the file. This scenario repeats many times. I do not understand what is going on, please help. I've tried this btw:

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

but it didn't help

Chiril
  • 1
  • Did you test multiple web browsers? Is the behavior same in all of them? Do you edit local/remote source? Are there used any builds for your site? – ino Feb 11 '22 at 07:44

1 Answers1

0

i have that same issue on i'm using free web hosting when i edit php files you need to wait couple of seconds before accessing it or else i receive blank page or the completely unedited version of it also i thought PHP tries to prevent browser caching by default?

anyway if you want to prevent user input staying "entered" when user get redirected and decided to use "back button" on browser just add autocomplete="off"

<form action="#" method="post" accept-charset="utf-8" autocomplete="off">

also if you want the prevent the form getting resubmit if user decided to refresh the page when they submitted the form i used this https://stackoverflow.com/a/38768140/17939597