Web浏览器、本机应用程序、第三方程序和系统服务一直在您的Mac上创建文件缓存。这些缓存确实会消耗存储空间,但它们也有助于加快速度。例如,下次您访问 Switching to Mac时,由于缓存了站点数据,您的浏览器将更快地加载它。同样,这几乎适用于您在Mac上执行的所有操作。
缓存文件也会被创建它们的程序和服务定期清除和更新。尽管如此,您仍然会遇到相当多的过时、损坏或臃肿的缓存,这些缓存会导致崩溃、减速和无数其他问题。发生这种情况时,您必须手动清除Mac上的缓存。(Mac)
浏览器带有内置的缓存清除机制,使整个过程快速而轻松。但是,清除应用程序和系统缓存确实需要一些工作。
如果释放存储空间是您的目标,那么您必须在完成所有其他磁盘清理选项(all other disk cleaning options)后才考虑删除缓存文件。
如何在 Mac 上清除浏览器缓存(How to Clear Browser Cache on Mac)
如果网站无法正常加载或运行,那么清除浏览器缓存通常是解决问题时必须做的第一件事。下面,您将学习如何清除Safari和Google Chrome中的浏览器缓存。
在 Safari 中清除浏览器缓存(Clear Browser Cache in Safari)
默认情况下,Safari不显示可让您清除其浏览器缓存的选项。所以,你必须先取消隐藏它。
1. 启动 Safari。然后,打开Safari菜单并选择Preferences。
2. 切换到高级选项卡并选中(Advanced)在菜单栏中显示开发菜单(Show Develop menu in menu bar)旁边的框。
3. 打开Develop菜单(您现在应该在菜单栏上看到它),然后选择Empty Caches。
在 Chrome 中清除浏览器缓存(Clear Browser Cache in Chrome)
如果您使用 Chrome 而不是Safari,则清除浏览器缓存相对简单。
1. 打开一个新的 Chrome 选项卡并按Shift+Command+Delete以调出清除浏览数据(Clear browsing data)屏幕。
2. 选择缓存的图像和文件(Cached images and files)选项,将时间范围设置为所有时间(All Time),然后选择清除数据(Clear data)。
可选 — 清除 DNS 缓存(Optional — Clear DNS Cache)
Mac上的DNS(域名服务)(DNS (Domain Name Service))缓存可帮助浏览器快速定位和连接到 Web 地址。如果Safari或Chrome仍然无法加载网站,则可能是过时的DNS缓存导致问题。在这种情况下,清除它会强制您的Mac获取最新的DNS数据。
1. 按Command+Space打开Spotlight Search。然后,键入Terminal并按Enter。
2. 在终端(Terminal)窗口中输入以下命令,然后按Enter。
sudo killall -HUP mDNSResponder
3. 输入您的管理员密码(administrator password)并按Enter清除 DNS 缓存。
如何在 Mac 上清除应用程序缓存(How to Clear Application Cache on Mac)
清除Mac上的应用程序缓存可以解决与程序和本机系统组件(邮件(Mail)、消息(Messages)、地图(Maps)等)相关的问题。虽然这很安全,但我们仍然建议您在继续之前创建 Mac 的备份。(create a backup of your Mac)然后,您应该可以选择恢复它,以防出现问题。
1. 退出所有打开的应用程序。然后,打开Finder并按Command+Shift+G调出转到文件夹(Go to Folder)框。
2.输入~/Library/Caches(不要忘记开头的波浪号)并点击Go打开应用程序缓存。
3. 按Command+A选择所有文件和文件夹,然后右键单击并选择移动到垃圾箱(Move to Trash)以删除整个应用程序缓存。
之后重新启动您的Mac。然后,右键单击Dock 上的垃圾箱图标并选择(Trash)清空垃圾箱(Empty Trash)以释放与已删除文件相关的空间。
如何在 Mac 上清除系统缓存(How to Clear System Cache on Mac)
清除应用程序缓存会删除大量与本机应用程序和系统组件相关的文件。如果您仍然遇到问题,您可以通过访问如下所示的两个位置来清除与操作系统相关的其他文件。在继续之前,不要忘记创建 Mac(Mac)的(Don)备份(如果您还没有)。
1. 打开 Finder 并按Shift+Command+G。
2.在Go to Folder框中 键入/Library/Caches(开头不带波浪号) 。
3. 按Command+A选择所有文件。然后,右键单击并选择Move to Trash。
4. 输入您的管理员密码(administrator password),然后单击“确定(OK)”删除项目。如果您的Mac阻止您清除某个文件或文件夹,请保持原样。
5. 重复步骤 1-4,但使用步骤 2 中的文件夹路径/System/Library/Caches代替。您可以删除此文件夹中的所有项目,但标有com.apple.kext.caches(com.apple.kext.caches)的子文件夹除外。
6. 以安全模式(Safe Mode)重新启动您的 Mac 。这有助于重置您无法手动删除的各种与系统相关的缓存。为此,请重新启动您的Mac,然后在启动提示音后立即按住Shift 键(Shift)。出现Apple标志后,松开 键(release the key)。
在您的Mac完成启动到安全模式(Safe Mode)后,只需正常重启即可。如果一切正常,您可以清空垃圾箱。
如何在 Mac 上使用 Onyx 清除缓存(How to Use Onyx to Clear Cache On Mac)
您还可以使用第三方清理工具来清除Mac上的浏览器、应用程序和系统缓存。这不仅使工作更容易,而且清理工具还可以深入挖掘并删除那些难以手动清除且不安全的东西(尤其是与系统相关的东西)。
我们推荐Onyx for Mac,这是一款已经存在多年的优秀(免费)工具。请记住在使用它清理应用程序和系统缓存之前备份您的Mac 。
安装Onyx后,打开它,然后切换到维护(Maintenance)选项卡。然后,您应该会看到Clean(Cleaning)部分旁边列出的所有缓存删除选项(System、Applications和Internet ) 。
您还可以使用“选项(Options)”按钮来选择缓存数据的各种子类别。但是,除非您的Mac有严重问题,否则最好坚持默认选择。
确定要删除的内容后,单击Run Tasks。Onyx 还附带了许多您可能想要查看的其他工具。(host of other tools)
CCleaner for Mac是另一个免费的清理工具。但是,该程序有隐私相关问题的历史(history of privacy-related issues),因此我们建议您避免使用它。
保持清醒,除非你必须(Stay Clear Unless You Have To)
尽管大多数人认为,您不必定期清除缓存文件以优化您的Mac。那只会让事情变慢。作为故障排除措施,您只能删除浏览器、应用程序和系统缓存。否则,让你的Mac 保持(Mac)原样,它应该可以很好地管理缓存的数据。
How To Clear Cache on a Mac
Web browsers, natiνe aрpѕ, third-party programѕ, and system services create caсhes of files on your Mac all the time. These caches do consume storage, bυt they also help speed things up. For example, the next time yоu viѕit Switching to Mac, your browser will load it much quicker due tо caсhed sіte data. Similarly, this applies to just аbout everything that you dо on yoυr Mac.
Cached files are also routinely cleared and updated by the programs and services that create them. Despite that, you will still encounter your fair share of obsolete, corrupted, or bloated caches that result in crashes, slowdowns, and a myriad of other issues. When that happens, you must clear the cache on your Mac manually.
Browsers come with built-in cache clearing mechanisms, which make the whole process quick and painless. However, clearing the application and the system caches do require some work.
If freeing up storage is your objective, you must only consider deleting cached files once you’ve gone through all other disk cleaning options.
How to Clear Browser Cache on Mac
If websites don’t load or function properly, then clearing the browser cache is often the first thing that you must do to troubleshoot the issue. Below, you will learn how to clear the browser cache in Safari and Google Chrome.
Clear Browser Cache in Safari
By default, Safari doesn’t display the option that lets you clear its browser cache. So, you must unhide it first.
1. Launch Safari. Then, open the Safari menu and select Preferences.
2. Switch to the Advanced tab and check the box next to Show Develop menu in menu bar.
3. Open the Develop menu (which you should now see on the menu bar), and then select Empty Caches.
Clear Browser Cache in Chrome
If you use Chrome instead of Safari, clearing the browser cache is relatively straightforward.
1. Open a new Chrome tab and press Shift+Command+Delete to bring up the Clear browsing data screen.
2. Select the Cached images and files option, set the Time Range to All Time, and then select Clear data.
Optional — Clear DNS Cache
The DNS (Domain Name Service) cache on your Mac helps browsers locate and connect to web addresses quickly. If Safari or Chrome still fails to load websites, an obsolete DNS cache may be causing the issue. In that case, clearing it will force your Mac to fetch the most recent DNS data.
1. Press Command+Space to open Spotlight Search. Then, type Terminal and press Enter.
2. Type the following command into the Terminal window and press Enter.
sudo killall -HUP mDNSResponder
3. Insert your administrator password and press Enter to clear the DNS cache.
How to Clear Application Cache on Mac
Clearing the application cache on your Mac can fix issues related to programs and native system components (Mail, Messages, Maps, etc.). While this is quite safe, we still recommend that you create a backup of your Mac before you proceed. You should then have the option to restore it in case something goes wrong.
1. Quit all open apps. Then, open Finder and press Command+Shift+G to bring up the Go to Folder box.
2. Type ~/Library/Caches (don’t forget the tilde at the beginning) and click Go to open the application cache.
3. Press Command+A to select all files and folders, and then right-click and select Move to Trash to delete the entire application cache.
Restart your Mac afterward. Then, right-click the Trash icon on the dock and select Empty Trash to free up the space related to the deleted files.
How to Clear System Cache on Mac
Clearing the application cache gets rid of lots of files related to native apps and system components. If you still keep experiencing issues, you can clear additional files related to the operating system by visiting the two locations as shown below. Don’t forget to create a backup of your Mac (if you haven’t already) before you proceed.
1. Open Finder and press Shift+Command+G.
2. Type /Library/Caches (without the tilde at the beginning) into the Go to Folder box.
3. Press Command+A to select all files. Then, right-click and select Move to Trash.
4. Enter your administrator password and click OK to delete the items. If your Mac prevents you from clearing a certain file or folder, just leave it be.
5. Repeat steps 1-4, but use the folder path /System/Library/Caches in step 2 instead. You can delete all items within this folder except for the sub-folder labeled com.apple.kext.caches.
6. Restart your Mac in Safe Mode. This helps reset various system-related caches that you can’t remove manually. To do that, restart your Mac, and then hold down Shift right after the startup chime. Once the Apple logo shows up, release the key.
After your Mac finishes booting into Safe Mode, simply restart it normally. If everything looks good, you can empty the trash.
How to Use Onyx to Clear Cache On Mac
You can also use a third-party cleanup tool to clear the browser, application, and system caches on your Mac. Not only does that make the job easier, but a cleanup tool can also dig in deep and remove stuff (especially those related to the system) that are otherwise difficult and unsafe to get rid of manually.
We recommend Onyx for Mac, an excellent (and free) tool that’s been around for years. Just remember to back up your Mac before using it to clean the application and system caches.
After installing Onyx, open it, and switch to the Maintenance tab. You should then see all cache removal options (System, Applications, and Internet) listed next to the Cleaning section.
You can also use the Options button to select various subcategories of cached data. However, It’s best to stick to the default selections unless you have serious issues with your Mac.
Once you’ve decided on what you want to delete, click Run Tasks. Onyx also comes with a host of other tools that you may want to check out.
CCleaner for Mac is another free cleanup tool. However, the program has a history of privacy-related issues, so we advise you to avoid using it.
Stay Clear Unless You Have To
Despite what most people believe, you don’t have to clear cached files regularly in hopes of optimizing your Mac. That will only end up slowing things down. You must only delete the browser, application, and system caches as a troubleshooting measure. Otherwise, leave your Mac as it is and it should manage cached data just fine.