当您在网上冲浪并遇到加载网站的问题时,您听到的最多的建议是尝试清除浏览器缓存(clear your browser cache)并删除 cookie。大多数计算机用户都熟悉这些术语。然而,并不是每个人都知道缓存的数据和 cookie 到底是什么,以及为什么要不时清除它们。
如果您想知道您的浏览器在您搜索网络时会收集哪些类型的数据,那么您可以在几个地方找到它。了解如何从浏览器中查看缓存的页面和文件,并决定是要保留这些数据还是永久清除它。
什么是 Cookie 和浏览器缓存? (What Are Cookies & Browser Cache? )
您的浏览器缓存是您计算机上存储缓存的 Web 内容(或缓存)的位置。
您的 Web 浏览器将您最近查看的页面的完整或部分副本与媒体(图像、音频和视频)一起存储在计算机上称为缓存的文件中。缓存文件是临时文件,可帮助更快地加载 Internet 页面。这就是为什么当您清除浏览器缓存时,您经常会看到网站的加载速度比平时慢(sites load slower than usual)。
Cookie 是包含与您访问的网页相关联的小段数据的文件。当您使用网络浏览器时,它们会存储在您的计算机上。他们的主要目的是跟踪您的在线活动。
Cookie 记录您最近访问网站或登录详细信息等信息。这就是为什么您在删除 cookie 后经常必须重新登录每个站点的原因。
浏览器缓存如何工作? (How Does Browser Caching Work? )
当您第一次访问网站时,浏览器会从服务器获取所有数据和媒体。
当您稍后再次访问同一站点时,浏览器仅从 Web 服务器检索HTML页面信息。
页面的所有静态部分(如图像或JavaScript 文件(JavaScript files))都是从现有浏览器缓存中提取的。由于第二次从远程 Web 服务器传输到您的浏览器的数据量要小得多,因此您的页面加载速度更快。
如何查看缓存的页面和文件 (How To View Cached Pages And Files )
为了查看缓存的页面和文件,您首先需要找到它们。你不能总是看到它们,因为它们存储的文件夹可能是隐藏的。
Mac 使用说明(Instructions For Mac)
在Mac上,这些文件存储在计算机资源库的(Library)Caches文件夹中。
找到Caches文件夹的一种方法是:
- 打开Finder并从功能区菜单中选择前往。(Go)
- 按住Alt(选项)(Alt (Option))键。您将看到库(Library)文件夹显示在下拉菜单中。
- 找到Caches文件夹,然后找到浏览器的文件夹以查看存储在计算机上的所有缓存文件。
更快的方法是:
- 打开查找器(Finder)
- 按住Cmd + Shift + G
- 输入/Users/USERNAME/Library/Caches/像/Users/Anya/Library/Caches/
- 按回车(Enter)键。
- 找到浏览器的文件夹以查看缓存文件。
Google Chrome 的缓存文件将位于Google > Chrome > Default > Cache文件夹中。对于Firefox和Opera ,分别查找Firefox和Opera 缓存(Opera cache)文件夹。
对于Safari 的缓存(Safari’s cache),使用不同的快捷方式:
/Users/USERNAME/Library/Containers/com.apple.Safari/Data/Library/Caches/.
Windows 使用说明(Instructions For Windows)
在Windows上,定位浏览器缓存的路径略有不同。例如,对于Google Chrome,它看起来像这样:
C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\Cache.
您还可以使用运行命令(Run command)找到 Chrome 的缓存文件夹。
通过“开始(Start)”菜单或使用快捷键Windows 键(Windows key)+ R访问“运行”命令。然后将以下内容复制并粘贴到命令行中:
\AppData\Local\Google\Chrome\User Data\Default\Cache.
由于所有互联网浏览器默认安装在系统 C 驱动器上,因此您可以通过类似的路径轻松地从任何浏览器中查看缓存的页面和文件。只需按照(Simply)\AppData\Local 路径搜索您的浏览器名称,例如\AppData\Local\Mozilla\Firefox\或 \AppData\Local\Microsoft\Edge\。
如何读取缓存文件
在Cache文件夹中,您会找到具有各种扩展名和随机文件名的文件。这里的困难是你不会确切地知道你在看什么。大多数名称都是随机的,无法分辨文件的格式或来源。
您可以单击每个文件将其打开,也可以使用特殊软件或浏览器扩展对缓存的文件进行解码。最好的选择之一是使用 Nirsoft 的Web浏览(Nirsoft)器工具之一。对于 Google Chrome,它是ChromeCacheView。
下载缓存查看器后,双击打开主窗口。您将找到存储在浏览器缓存中的文件的完整列表。
除了文件名之外,您还会看到URL、文件类型和大小以及其他属性。您可以导出单个文件或完整列表,复制缓存文件的URL(URLs),如果要将文件保存在另一个文件夹中,可以从缓存中提取文件。
不幸的是,Nirsoft实用程序仅在Windows上运行。因此,如果您想使用它来解码Mac上的缓存文件,您必须将整个缓存文件夹转移到Windows机器上,然后使用该软件读取您的文件。
如何在浏览器中查看 Cookie
由于 cookie 负责将您的私人详细信息暴露给网络,因此在大多数浏览器中,您可以在“设置”的“(Settings)隐私(Privacy)”部分找到它们。
例如,如果您想在Google Chrome中查看 cookie ,请转到Chrome功能区菜单并选择Preferences。从那里,按照路径Privacy and security > Cookies and other site data。
向下滚动并单击查看所有 cookie 和站点数据(See all cookies and site data)。您将获得存储在Chrome浏览器中的所有 cookie 的列表。
然后由您决定是否保留或删除这些跟踪 cookie。
管理 cookie(Managing cookies)并不是一项艰巨的任务,但知道如何操作很重要,因为每个浏览器的过程都略有不同。
是时候清除浏览器缓存了(Time To Clear Your Browser Cache)
虽然保留浏览器缓存有一些优势,但如果您不定期清除它,您可能会冒着这些数据占用硬盘驱动器太多空间的风险。这可能会导致您的计算机运行缓慢(computer’s sluggishness),并要求您迟早采取行动。
您(Did)是否尝试过从 Web 浏览器查看缓存的页面和文件?你用了什么方法或捷径?在下面的评论中分享您对浏览器缓存的体验。
How To See Cached Pages And Files From Your Browser
When you surf thе web and run across аn issue wіth loading websites, the adviсe you’ll hear most is to try to clear your browser cache and delete cookies. Most computer users are familiar with these terms. However, not everybody knows what exactly cached data and cookies are and why you should clear them from time to time.
If you ever wondered what kind of data your browser collects when you search the web, there are a few places where you can look for it. Find out how to see cached pages and files from your browser and decide whether you’d like to keep that data or clear it for good.
What Are Cookies & Browser Cache?
Your browser cache is a location on your computer where the cached web content (or cache) is stored.
Your web browser stores complete or partial copies of the pages you recently viewed together with the media (images, audio, and video) in a file on your computer called the cache. The cached files are temporary files that help the internet pages load quicker. That’s why when you clear your browser cache, you’ll often see that the sites load slower than usual.
Cookies are files that contain small pieces of data associated with the web pages that you visit. They’re stored on your computer while you use your web browser. Their primary purpose is to track your online activity.
Cookies record information like your most recent visit to the website or your login details. That’s the reason why you often have to log into every site all over again after you delete your cookies.
How Does Browser Caching Work?
When you visit a website for the first time, the browser fetches all the data and media from the server.
When you visit the same site again later, the browser retrieves only the HTML page information from the web server.
All the static parts of the page like images or JavaScript files are pulled from the existing browser cache. Since the second time the size of data transferred from the remote web server to your browser is much smaller, your page loads faster.
How To View Cached Pages And Files
In order to see cached pages and files, you first need to locate them. You can’t always see them since the folder where they’re stored may be hidden.
Instructions For Mac
On Mac, the files are stored in the Caches folder in your computer’s Library.
One way to locate the Caches folder is to:
- Open Finder and select Go from the ribbon menu.
- Hold down the Alt (Option) key. You’ll see the Library folder show up in the drop-down menu.
- Find the Caches folder and then your browser’s folder to see all the cached files stored on your computer.
A quicker way to do this is to:
- Open Finder
- Hold Cmd + Shift + G
- Type in /Users/USERNAME/Library/Caches/ like /Users/Anya/Library/Caches/
- Press the Enter key.
- Find your browser’s folder to see the cached files.
Google Chrome’s cached files will be in the Google > Chrome > Default > Cache folder. For Firefox and Opera look for the Firefox and Opera cache folders respectively.
For Safari’s cache, use a different shortcut:
/Users/USERNAME/Library/Containers/com.apple.Safari/Data/Library/Caches/.
Instructions For Windows
On Windows, the path to locate the browser cache is a little different. For example, for Google Chrome it looks like this:
C:\Users\USERNAME\AppData\Local\Google\Chrome\User Data\Default\Cache.
You can also find Chrome’s cache folder using the Run command.
Access the Run command through the Start menu or using the shortcut Windows key + R. Then copy and paste the following into the command line:
\AppData\Local\Google\Chrome\User Data\Default\Cache.
Because all internet browsers are installed on system C drive by default, you can easily see cached pages and files from any browser by following a similar path. Simply search for your browser’s name after following the \AppData\Local path, like \AppData\Local\Mozilla\Firefox\, or \AppData\Local\Microsoft\Edge\.
How To Read The Cached Files
Inside the Cache folder you’ll find files with various extensions and random file names. The difficulty here is that you won’t know exactly what you’re looking at. Most of the names are random and there’s no way to tell the format of the file or where it came from.
You can either click on every file to open it or decode the cached files using special software or a browser extension. One of the best options is to use one of the web browser tools by Nirsoft. For Google Chrome it’s the ChromeCacheView.
After you download the cache viewer, double-click to open the main window. You’ll find the complete list of files stored in the cache of your browser.
Aside from the filename, you’ll see the URL, file type and size, and other properties. You can export a single file or a full list, copy the URLs of your cached files, and extract the files from the cache if you want to save them in another folder.
Unfortunately, Nirsoft utilities run exclusively on Windows. So if you want to use it to decode your cached files on Mac, you’ll have to transfer your entire caches folder onto a Windows machine and then use the software to read your files.
How To View Cookies In Your Browser
Since cookies are responsible for exposing your private details to the web, in most browsers you can find them in the Privacy section of the Settings.
For example, if you want to view cookies in Google Chrome, go to the Chrome ribbon menu and select Preferences. From there, follow the path Privacy and security > Cookies and other site data.
Scroll down and click See all cookies and site data. You’ll get a list of all the cookies stored in your Chrome browser.
Then it’s up to you whether to keep or remove those tracking cookies.
Managing cookies isn’t a difficult task, but it’s important to know how to do it as the process is a little different in each browser.
Time To Clear Your Browser Cache
While keeping your browser cache in place has some advantages, if you don’t clear it regularly you risk this data taking up too much space on your hard drive. That can contribute to your computer’s sluggishness and will require you to take action sooner or later.
Did you ever try to see cached pages and files from your web browser? What method or a shortcut did you use? Share your experience with the browser cache in the comments below.