Vezi pagina în română

IT Glossary

What is a cache (cache memory) and how does it work

Temporary memory where processors, browsers, apps and servers keep copies of frequently requested data, so they don’t redo the same work on every access.

7
sections
6
questions answered

A cache (pronounced like “cash”) is temporary storage where a processor, a browser, an app or a server keeps copies of frequently requested data so it can serve them again without downloading or computing them twice. Example: on the first visit, the browser downloads a site’s images, CSS and JavaScript files and keeps them on the device; on the second visit it takes them from there, not from the internet. The principle is the same everywhere in computing: never redo work already done.

For a business, caching works in three places: the website remembers its generated pages so it doesn’t rebuild them for every visitor, the customer’s browser holds on to static files, and a CDN keeps copies of the site close to visitors. Speed shows up in conversions and in Core Web Vitals, which Google measures. The flip side: copies can go stale, hence the classic “I updated the site but nothing changed”, and the rule that prices and stock levels should be cached briefly or not at all.

Why it matters for your business

Speed without a pricier server

Pages served from cache are no longer generated or downloaded again, so they open faster and the same hosting plan carries more visitors.

Infrastructure costs kept down

Work that isn’t repeated means less processing and less bandwidth — at high traffic, the difference shows up directly on the hosting bill.

Better experience, better SEO

Google measures real page speed; a correctly configured cache is the cheapest point you can score on Core Web Vitals.

How a cache works: hit, miss and lifetime

Every request starts with a lookup in the cache. If the data is there and still valid, it is a “cache hit” and the answer comes back immediately. If it is missing or expired, it is a “cache miss”: the data is fetched from the source and saved in the cache for next time.

On the web, the server sets how long a file may be kept using the Cache-Control header; for example max-age=2592000 means 30 days (RFC 9111, section 5.2.2.1). When the lifetime runs out, the browser can ask the server “has it changed?” by sending the file’s ETag (RFC 9110, section 8.8.3). If it hasn’t, the server answers 304 Not Modified with no body (RFC 9110, section 15.4.5), and the file is not downloaded again.

Types of cache: CPU, browser, app, server and CDN

CPU cache: very fast memory, in levels L1, L2 and L3, located on the chip itself; this is the original, hardware meaning of “cache memory”. Browser cache: the images, CSS and JavaScript of the sites you visit. App cache on a phone: thumbnails and temporary files of each app, exactly what “Clear cache” removes on Android.

Server cache: ready-made pages or results kept in RAM, for example with Redis. CDN cache: copies of the site on servers near the visitor, covered under CDN. DNS cache: the device remembers a domain’s IP address for as long as the record’s TTL, detailed under DNS. Proxy cache: a proxy can keep copies for a whole network, a topic covered under proxy.

Want an estimate for your project?

Message us on WhatsApp. We reply the same working day, and the first 30-minute call is free.

Book a free call

A cache keeps copies of files so pages load faster; you can delete it with no visible loss other than a slower first load. A cookie is a small piece of data a site saves to recognise you: login, shopping cart, preferences. Deleting cookies signs you out, deleting only the cache does not (source: Google Account Help). In Chrome, both sit in the same “Delete browsing data” dialog as separate checkboxes. Cookie types are covered under cookie.

How to clear the cache in Chrome, on Android, Samsung and iPhone

Chrome on a computer: Ctrl + Shift + Delete (on Mac: ⌘ + Shift + Delete) opens “Delete browsing data”. Pick the time range, tick only “Cached images and files” and press “Delete data”. For a single page, reload it without the cache with Shift + F5 or Ctrl + Shift + R (on Mac: ⌘ + Shift + R).

Chrome on Android: “More” (the three dots), then “Delete browsing data”, “More options”, tick the cache and press “Delete data”. The default range is 15 minutes, so choose a longer one if you want to clear everything.

An app’s cache on Android or Samsung Galaxy: Settings > Apps > the app > Storage > “Clear cache”. Note the difference: “Clear data” resets the app and deletes its saved data.

Safari on iPhone: Settings > Apps > Safari > “Clear History and Website Data”; note that this also deletes history. To keep your history, go to Safari > Advanced > “Website Data” and remove the website data. Firefox has the same option in its privacy and security settings.

Caching on a company website: what to cache and what not to

Static files with versioned names (images, fonts, CSS, JavaScript) get long lifetimes: Chrome’s “Use efficient cache lifetimes” check asks for at least 30 days. HTML pages get short lifetimes or are revalidated on every request.

Pages holding a customer’s data (account, cart, checkout) are marked “private” or “no-store”, so no shared cache such as a CDN or proxy keeps them (RFC 9111, sections 5.2.2.7 and 5.2.2.5). Prices and stock either stay out of the cache or are purged on every change, and publishing a new page should trigger a purge of the copies at the CDN and on the server. Where the site is hosted matters, see hosting.

Frequently asked questions

I changed my website but the change doesn’t show — why?

Almost certainly a stale cached copy: in your browser, on the site itself or at the CDN. Check in an incognito window; if it looks right there, clear the site cache — and your developer can configure automatic invalidation on publish so this stops recurring.

Can caching show customers outdated prices or stock?

Yes, if configured lazily — pages with dynamic data must be excluded from caching or refreshed on every change. It is a common configuration mistake in online shops, not an inevitability of the technology.

What does “Use efficient cache lifetimes” (formerly “leverage browser caching”) mean in speed tests?

Your site isn’t telling browsers how long to keep static files. “Leverage browser caching” (older PageSpeed) and “Serve static assets with an efficient cache policy” (Lighthouse up to version 13, still used in GTmetrix) are the same check. Chrome now calls it “Use efficient cache lifetimes” and asks for at least 30 days. The fix is a Cache-Control header.

What happens if I clear the cache?

You lose nothing personal and stay signed in, because only deleting cookies signs you out. Sites and apps load slower the first time, since images download again. In return you free up storage and can fix display errors.

What is cache memory on a phone and where do I find it?

It is the temporary files the browser and each app keep on the phone: thumbnails, images, downloaded pages. On Android you find it under Settings, Apps, the app, Storage. On iPhone there is no per-app button; Safari’s cache is cleared from Safari’s settings.

Is a cache the same as RAM?

No. RAM is the main working memory of a device, while a cache is a smaller, faster or closer store of copies. A CPU cache sits on the chip, and a browser cache is kept on disk. Both exist so the same data isn’t fetched or computed twice.