After GDPR, we were all made painfully aware of just how common cookies are in our internet browsing sessions. But what do they actually do? And what makes them different from cache, the other thing we’re always told to delete to solve internet issues? Here’s the article that will clear it all up.
Cache vs. cookies: in short
Cache saves the website resources (images, videos, etc.) on your device to make it load faster on repeated use.
Cookies save information about your use of a particular website for the website’s benefit.
What is cache?
Cache – almost synonymous with local storage – makes websites load faster by saving heavier webpage resources on your device. Stuff stored in cache is usually static and unchanging, which is why you don’t need to download it every time you visit the page. Examples of what cache stores are:
- Images (logos, background, cat pictures, etc.)
- Videos (you know, YouTube)
A non-obvious thing about using the web is that everything you see on webpages is downloaded and stored on your device in some shape or form – otherwise, you wouldn’t be able to see it. Unlike right-clicking to save a cat picture or an NFT, this is done without your active participation – seeking your approval to download every aspect of the website is just impractical.
The same applies to bandwidth usage – it makes no sense to download the same image 100 times if you navigate through 100 pages of the website.
- You’re visiting Surfshark.com.
- The browser downloads the Surfshark logo in the top left corner once into the cache.
- The logo is loaded from the cache every time you go to a different page on Surfshark.com.
- You save around 6kB of data per page.
Some issues may arise if the web resources downloaded into the cache are corrupted by an interrupted download or some other issue. That’s why you may get broken website elements (it’s loading from the browser’s cache, file integrity be damned) or, potentially, not see the freshest version of the site. Clearing the cache makes the device redownload the website elements and solves that issue.
A browser cache can be cleaned out – deleted – manually. The web resources stored there are not required for the website to be used again. Once deleted, they can be redownloaded. On devices with limited storage (old PCs, some smartphones, etc.), clearing the browser cache is a trick to free up space.
Note: Cache as a concept exists outside of web cache, but those don’t matter for the purposes of this article.
What is a cookie?
A cookie is a very tiny file that a website uses to store information about you on your device. It’s one of the ways a website remembers user preferences. Aside from user ID and session ID, it can store stuff like form-filling data, pages on the site you visited before, what buttons you pressed, and what you have in your shopping cart (though the latter is often stored on the server-side these days).
There are transient and persistent cookies. Transient cookies expire every time you close the browser, deleting any temporary tracking data they stored. Persistent cookies store data persistently, from browsing session to browsing session.
Cookie data is transmitted every time you make a request on the website – it usually involves navigating to other pages on the site. By having the ID paired with the request, a website can personalize replies to you, the user. That’s one of the ways store sites know to display the exact contents of the shopping cart no matter what page you’re on.
Two significant variants of cookies-by-function are authorization cookies and tracking cookies.
- Authorization cookies make it unnecessary to log into Facebook every time you enter Facebook.com. The cookie authenticates the user to the website automatically and thus saves you a few seconds. And yes, there have been security issues with the Magical File That Lets You Access An Online Account before.
- Tracking cookies are persistent cookies that keep data on you and your browsing habits. That’s how a website owner can create a picture of what pages a user visited in what order and how long they stayed here. Tracking cookies are what enables annoying “personalized” targeted ads, search results that are tailored to you, and marketing departments that get up in copywriters’ grill about “bounce rates” and other gibberish.
Some cookies are functional and required for the site to work properly. But as you’ve discovered with all the post-GDPR cookie warnings and settings*, a lot of them are garbage that increases your digital footprint, only benefiting the website and not you.
Note: A website server stores some data on you when you browse it. That data is called a “session,” and you can’t delete it since it’s not on your device.
*Tired of having to deal with the cookie warnings everywhere you go? Get our Cookie pop-up blocker!
What’s the difference between cache and cookies?
Having provided detailed descriptions above, here’s a table:
Stores website information for repeated use.
Stores information about your interaction with the website.
Stores your session ID, IP address, location, field entry results, etc.
Stored on your device only.
Has a session counterpart on the web server.
Takes up a lot of space.
Takes up very little space.
Has to be cleaned manually.
Technically has an expiration rate.
Is not sent to the website.
Is sent to the website with a request.
Saves bandwidth and the time it takes to load.
Saves time for user interactions like typing stuff in or marking choices.
Can be used to track you.
Is definitely used to track you.
Deletion means redownloading the assets next time you visit.
Deletion means redoing all the user preferences next time you visit.
Should I clear cache or cookies?
Whether you should clear cache or cookies depends on what you want to do.
- Clear cache if you want to see a fresh version of the website, solve website loading issues, or free up space.
- Clear cookies if you want to remove search history on websites, e.g. Facebook,, protect your data on a shared device, and prevent tracking.
Is clearing cache and cookies bad?
By clearing cache and/or cookies, you always sacrifice convenience: next time you visit, the website will take more time to load, you’ll have to log into the accounts again, any site settings will be gone, and you’ll have to enter stuff into form fields anew.
That said, nothing vitally important relies on cache or cookies.
Is browsing history the same as cookies?
No. Browsing history is just a log of websites and pages you visited. Cookies store information about what you did on individual websites.
Take a look at your own cookies
Cookies and cache are but two of the many technologies that make the internet work. In a vacuum, they’re neither good nor bad – they’re just there. However, the way businesses approach the online world – and how they extract profit from it – means that they can be used for nefarious purposes.
Are cookies harmful to a computer?
No, cookies are not harmful to a computer or any other device. By default, they’re just a tiny bit of internet infrastructure.
Crumbling an actual physical cookie into the insides of your computer isn’t recommended.
Why are websites asking about cookies?
The General Data Protection Directive (GDPR) of the European Union laid out transparency requirements about what data websites collect and how they use it. That’s why you need to be informed and asked about cookie use. It’s genuinely a good thing, but most of us are too busy to be able to fully delve into it.