Skip to main content
miji.be

Cache

A temporary storage mechanism that saves previously fetched data for faster subsequent access. Browser cache and DNS cache are common examples.

Oct 4, 2026 / About 2 min read

Redirect

A cache is a temporary storage layer that keeps copies of frequently accessed data so it can be retrieved faster next time. Imagine keeping your most-used textbooks on your desk instead of walking to the bookshelf every time you need them. The desk is your cache - it holds a small amount of data that you can grab instantly, saving the time of fetching it from the original source.

Browser cache is the most familiar type. When you visit a website for the first time, your browser downloads and saves images, CSS files, JavaScript, and other assets locally. On your next visit, the browser loads these saved files instead of downloading them again, making the page appear much faster. This is one reason why websites you visit regularly load more quickly after the first visit.

DNS cache is another important example. When your browser translates a domain name (like google.com) into an IP address, it stores the result in a local cache. The next time you visit the same domain, the browser skips the DNS lookup entirely and uses the cached IP address, shaving milliseconds off the connection time.

Every cached item has an expiration period: DNS records carry a TTL (Time To Live), and web files use settings such as the max-age value of the Cache-Control header. For web files, when that period ends, the data becomes stale, but it is not simply thrown away: the browser asks the server whether the file has changed and keeps using its copy if it has not. Web developers set these periods per file - static assets like logos might be cached for months, while dynamic content might be kept for just minutes.

Cache behavior has interesting implications for short URLs. When a browser caches a 301 (permanent) redirect, subsequent clicks on the same short URL bypass the shortening service's server entirely - the browser redirects directly to the destination. This is faster for the user but means the shortening service cannot count those repeat clicks in its analytics. Under the HTTP specification, a 302 (temporary) redirect is not cached by default, so each click on it reaches the shortening service.

Occasionally, cached data causes problems. If a website updates its content but your browser still shows the old cached version, you can force a fresh load with a shortcut such as Ctrl+F5 (the keys vary by browser). This tells the browser to ignore its cache and download everything from scratch.

Was this article helpful?

Related Terms

Browser

Software used to access and display websites. Browsers interpret HTML, CSS, and JavaScript to render web pages on screen.

TTL

Time to Live - a value that specifies how long data should be cached or considered valid before being refreshed.

DNS Resolution

The process of translating a human-readable domain name into the IP address of the server hosting the website.

Redirect Caching

A mechanism in which browsers and CDNs store redirect responses for a certain period and skip querying the origin server on later visits.

Cookie

A small piece of data stored in the browser by a website. Cookies enable login persistence, shopping cart retention, and user tracking.

URL Shortener Architecture

The internal design of a URL shortening service, covering ID generation, database design, caching strategy, and redirect handling.

Related Articles

How Redirect Chains Impact Web Performance - Speed Optimization for Short URLs

Quantitative analysis of how short URL redirect chains affect Core Web Vitals and page load speed. Covers redirect hop optimization, edge redirects, and HTTP status code selection for maximum performance.

What Happens When You Click a Link? A Peek Behind the 0.5-Second Curtain

What happens behind the scenes when you click a link? An adventure-style guide covering DNS, requests, responses, and how URL shortener redirects work.

How URL Shorteners Work - The Technical Side of Redirects

Discover the technical mechanics behind URL shortening: hash generation, database lookups, HTTP redirects, and more. Includes HTTP response examples and base-62 encoding calculations.

FAQ

How do I clear my browser cache?
In Chrome, go to Settings, then 'Delete browsing data,' check 'Cached images and files,' and click Delete. In Safari on Mac, open Settings, click Privacy, then Manage Website Data and remove the data. This also removes cookies, so you may be signed out of websites. On smartphones, find the option in your browser's settings menu. Each browser places the option in a slightly different location, but the process is straightforward.
Is it safe to clear my cache?
Yes. If you clear only the cache, the only effect is that websites will load slightly slower on your next visit as the browser re-downloads assets. Your sign-ins and saved passwords stay in place - those are managed by cookies and other mechanisms, not the cache.
What is the difference between cache and cookies?
Cache stores files like images and stylesheets to speed up page loading. Cookies store small text data like login tokens and preferences to identify users. They serve different purposes but are both stored locally in your browser. Clearing one does not necessarily clear the other.

Put the terms to work

Shorten a URL for Free