问题
I have been using XAMPP to connect to localhost to do editing on my computer for websites. I have been using it for over a year now and in the past whenever I would update the local file, I could refresh the page on my browser and it would immediately update. Now, I can't get it to update even if, for example, an image file has changed.
I'm wondering if it's an issue with cookies (which I haven't had in the past). Is there a common reason that this happens? I couldn't find anything upon a search. Thanks for the help!
回答1:
First thing to try would be clearing browser history/cache and reloading the browser.
If you enabled some kind of caching that might also explain it.
You could test by creating a new page on localhost and see if it works. If so, then check that any pages you're changing on localhost are actually being updated (check the file modified times and close/reload the source to see if the changes are actually there).
回答2:
Just delete all the temporary browser related files, I used C-Cleaner.
Add header <meta http-equiv="Cache-control" content="no-cache">
I solved use this method.
回答3:
I've had the same problem and solved it simply by reloading the current page, ignoring cached content. There is a shortcut that I know works for Chrome and Firefox:
Ctrl + Shift + R
I hope it will make life easier for some people.
回答4:
I thought this was happening with me but I had basically made a very basic but deceptive error: I had moved the .php file to a new folder on the server AFTER having openend it in Notepad to edit it. I had entered the new URL in the Web browser to account for this move in order to view the page generated from the .php file but I was still working on the file in Notepad openeed BEFORE I moved it. Consequently, I was saving changes to the file pre-move and not able to understand why on earth it wasn't changing the page in the browser. Dumb perhaps but had me perplexed.
回答5:
I've seen other people with the same problem. They've just moved to WAMP. If there is not a specific reason for you to stick with XAMPP you could give it a try. Hope this helps.
回答6:
I experienced this is issue recently using Django 2.1. I tried every browser, cleared my cache multiple times, triple checked that I was using Python's SimpleHTTPServer in the same directory I was writing my code, and even did a full reboot... No luck.
Right before throwing my MacBook out the window, I solved the problem by changing my Debug
setting from False
to True
. Why did this work? I'm not quite sure since the documentation for this setting doesn't mention that kind of behavior at all, but it was the only thing I could remember recently changing to possibly allude to this ghost bug. If anyone has a specific source to confirm this information, please comment and I will edit my answer.
Hope this helps anyone about to Hulk smash their computer :-)
回答7:
Clear Your Browser History or Cache.
Try the same with Different Browser that is if you are using Chrome then use Mozila and others or vice versa.
来源:https://stackoverflow.com/questions/12683417/localhost-wont-immediately-update