pmarks-net / ipvfoo

Display the current page's IP version and addresses
Apache License 2.0
555 stars 51 forks source link

Feature - clear DNS cache #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please consider adding the action of clearing the browser DNS cache as a button 
or link in the window displaying IP adresses.
Thanks.

Original issue reported on code.google.com by falun...@gmail.com on 4 Mar 2013 at 10:55

GoogleCodeExporter commented 9 years ago
This is sort-of possible, using the following API calls:
(1) chrome.benchmarking.clearHostResolverCache();
(2) chrome.benchmarking.clearCache();

(1) affects the DNS cache, and (2) affects the HTTP cache.  The data IPvFoo 
receives ultimately depends on both caches, so there are probably scenarios 
where you'd want to clear both.

In any case, the APIs only work if you launch Chrome with the 
--enable-benchmarking flag, so such a feature would be quite tedious to use.

How well does the following extension fit your use case?  It uses API (1):
https://chrome.google.com/webstore/detail/dns-flusher-for-chrome/fegcjmebpcoihkf
djilmnemfkgjbneol

Original comment by sparkm...@gmail.com on 5 Mar 2013 at 6:27

GoogleCodeExporter commented 9 years ago
Thanks for the response. Of course I can use another extension for this, and 
the one you mentioned works well. I thought it would be handy to have it in one 
extension, but I understand your reason. Ultimately, it's up to you to include 
it and anyone can always modify the copy of the source code for any specific 
needs.

Original comment by falun...@gmail.com on 5 Mar 2013 at 7:38

GoogleCodeExporter commented 9 years ago
Turns out this is actually not impossible.  Chrome provides an API to clear the 
history, and if you give it a timestamp in the future, it leaves the history 
intact but still dumps the DNS cache:

chrome.browsingData.remove({
  "since": (new Date()).getTime() + 86400e3
}, {
  "history": true,
}, function() {
  console.log("done!");
});

A similar call could be used to wipe the entire HTTP cache.

So then the question becomes, is this really an appropriate feature for IPvFoo, 
and if so, which of the two caches should it clear?

Original comment by sparkm...@gmail.com on 9 Mar 2013 at 6:35

GoogleCodeExporter commented 9 years ago
On further thought, I don't see much benefit to including this in IPvFoo's UI, 
when it can just as easily be done using a second extension with its own button.

My recommendation is that you find a favorite cache-clearing extension, and if 
it doesn't handle the DNS case, then pass along my "clear the future history" 
idea to the developer.

Original comment by sparkm...@gmail.com on 9 Mar 2013 at 8:32