Every time I update my web, I need to clear the browser cache before I can see my updates, if I do not clear the cache, I won't see the updates. I fear that other users won't see my updated web if they do not clear the cache. How do I solve this problem?
There is a nocache in the developer options! Press f12 -> got to network tab -> check disable cache
Related
I was checking the Application tab in the Chrome DevTools to debug an analytics issue and I noticed that the cookies section was empty, although the cookies menu under the lock icon in the chrome search bar seemed to show the cookie that I was interested in.
I did a bunch of refreshing, clearing site data, and restarting Chrome with no change in behaviour.
Is this a bug in Chrome? Why is there a discrepancy between the two menus? Does it have to do with httpOnly or secure cookies?
Not a very important question, mostly just curious!
I don't have an authoritative answer on this, but I think the explanation is in the language on top of this dialog: It says "The following cookies were set when you viewed this page". So it just shows whatever was set originally – or even "at some point" when you viewed the page. The message is not clear on this detail.
I can definitely confirm from my own tests that it will keep listing cookies that have since been deleted. Dev tools however always show the current state of cookie storage.
Whether it's a bug or not I suppose one could discuss at length, seeing as the behavior is not in conflict with the description. But it's certainly not expected behavior, and its usefulness for non-technical users is I think at least questionable.
This also lists "folder" type entries for indexed DBs, local storage and session storage which are not useful at all because you can't drill down. All of this and the missing punctuation on the message on top makes me think this is orphaned or forgotten code.
I also have no idea where that info is stored or how one might be able to purge it.
ETA: After some more experience with this discrepancy, I have since come to the conclusion that the list shown via the lock icon will show any kind of write access to the cookies. Since there is no dedicated "delete" operation for cookies, but you delete them by setting them with an expiration time in the past, deletions would still count as write access. So it looks pretty much like the dev tools seem to be only showing cookies that are still effectively there, i.e., would be sent to the server in a request, while the list in the lock icon is just a log of write accesses to cookie storage. This is still not definitive, but completely fits all my observations so far.
I work in the chrome environment a lot. Occasionally I will run applications which take days to run, and I frequently encounter the "JS Heap out of memory error message".
I have discovered that this wasn't actually due to my own application, but due to Chrome's automatic console history saving.
At the moment, I periodically and manually clear the console history, but this is tedious and requires that I am present. Is there a way to do this automatically.
I've thought about simulating a keystroke and I've tried disabling "Autocomplete from history", but the latter doesn't work.
Any ideas?
Adding:
localStorage.clear();
to my code solves it.
I am working on a new site and whenever I change CSS settings chrome will not accept those changes unless I close out of chrome completely with Task manager and relaunch it. I have a tried quite a few things. Below is a list of things I've tried:
Versioning the CSS file (I am using a PHP date stamp at the end of the CSS file
Enabling "Clear Cache while developer window is open" in the Developer console
Using Ctrl + F5 to clear cache on refresh
Going to Application and Clear Storage in the developer Console
Clearing Cache folder in local AppData
Deleting CSS file from stie, refreshing, and readding file.
Incognito mode
Adding Launch options to chrome shortcut --disk-cache-dir=null
Adding Browser Plugins to delete cache.
Anyone have any ideas how to help? It is extremely annoying and inefficient to close chrome every time I want to check a CSS change. Another annoyance is that I am trying to listen to music in the browser so if I close chrome I have to go back and get my music playing again and it's just as of now extremely annoying and way more time consuming than I want.
I've tried looking at other articles online about cache busting and other articles on Stack Overflow but I've tried to do most of what they suggest and I haven't seen any positive outcome yet. Most articles say to add some sort of random string or version on the end of the CSS file as a GET request but that isn't working though I know that has worked for me in the past.
pres f12 > f1 > network > disable cache (while DevTools is open). This should solve your problem
Development server was running various caching tools though they should have been turned off. After disabling them chrome started to work better and most of the time CTRL+F5 did the trick.
"clearing cache" is not as easy as it should be. Instead of clearing cache on my browsers, I realized that "touching" the server files cached will actually change the date and time of the source file cached on the server (Tested on Edge, Chrome and Firefox) and most browsers will automatically download the most current fresh copy of whats on your server (code, graphics any multimedia too). I suggest you just copy the most current scripts on the server and "do the touch thing" solution before your program runs, so it will change the date of all your problem files to a most current date and time, then it downloads a fresh copy to your browser:
<?php
touch('/www/sample/file1.css');
touch('/www/sample/file2.css');
touch('/www/sample/file2.css');
?>
then ... the rest of your program...
It took me some time to resolve this issue (as many browsers act differently to different commands, but they all check time of files and compare to your downloaded copy in your browser, if different date and time, will do the refresh), If you can't go the supposed right way, there is always another usable and better solution to it. Best Regards and happy camping. By the way touch(); or alternatives work in many programming languages inclusive in javascript bash sh php and you can include or call them in html.
I used to have the same problem, and I believe it's a (pretty annoying) bug with chrome. You can use the CSS Reloader Chrome Extension to solve it. Not ideal, but better
If you are trying out new CSS updates, I suggest using Chrome's "Inspect" function to dynamically update CSS settings and observe the results interactively. This may save some time during update cycles as compared to manual edits alone.
Another option to try is to define "cache-control" meta tags in your head section. For development/testing, you may want to have no caching. For a real website, you may want to have a shorter age limit. Refer to the following SO Q&A.
Using meta tags to turn of caching in all browsers?
I'm experiencing an issue that has only started occurring in the last month or so. The http request log in the network tab stops recording requests after the initial page load. I get how this behaviour might be desired in some circumstances, but in my case it's not very useful. I'm making several http requests after the initial page load, and unless I remember to hit record I won't see anything in the log.
Is this a problem others are having? Is there a setting buried away somewhere that can rectify this?
I had the same problem, make sure that the "Capture screenshots" feature (camera icon) is disabled in Chrome Developer Tools.
I had the same problem. There's a simple solution.
Go to Developer tools Settings > Preferences and then tap on Restore defaults and reload.
I got this message when I tried to log off from a site:
You are Successfully logged Out of blah blah.It is recommended that you close your browser when finishedto avoid unauthorized reentry.
Whey do they want us to restart the browser?I know it has got to do with session/cookie.What potential threat will not restarting cause?Is there a way to avoid this restart and still be safe?
Thanks
Theoretically, if you don't close your browser, someone can sit down at your machine and click the back button to see information associated with whatever you were doing - that could be bank accounts, credit card info, personal information - whatever. Unless the site screwed up horribly in their disabling of your session, they can't actually look at anything you didn't look at in that session, or actually change anything, but just being able to see the information might be all they need.
The reason this happens is that browsers tend to cache pages - if you click the back button, it will often load the page from its cache, rather than download it all again.
Of course, it's entirely possible that your browser decided not to cache these particular pages - I seem to recall that at least IE will never cache HTTPS traffic, although I could be wrong - but by showing the message at logout time, then you can't really say you haven't been warned.
Not all browsers actually remove deleted cookies until they are shut down.
I don't think restarting the browser will make any change to cookies. We can customize browsers to clear all private data when the browser starts. So by restarting in these cases can be useful. Otherwise there won't be any advantage of doing this.
The only thing that restarting the browser would do is that it would delete session cookies. I don't see any reason why the site couldn't delete it's own cookies, so it shouldn't be a problem.
Another possibility (aside from cookies) is that they are using Basic Authentication or Digest Authentication. With these mechanisms, there is no portable way to tell the web browser to clear the site's authentication details.