Grokking the System Design Interview
Ask Author
Back to course home

0% completed

Vote For New Content
Shouldn't the redirect use 301 instead of 302? Browsers cache when the returned ...

Diego Santiviago

Feb 18, 2022

Shouldn't the redirect use 301 instead of 302? Browsers cache when the returned page uses HTTP 301, while 302 is not the case.

0

0

Comments
Comments
Design Gurus
Design Gurus4 years ago

We suggested 302 redirect because a 301 redirect indicates that the page has permanently moved to a new location, whereas, a 302 means that the page has moved to a new location, but that it is only temporary.

On this page

  1. Why do we need URL shortening?

Try it yourself

Designing URL Shortener (video)

  1. Requirements and Goals of the System
  1. Capacity Estimation and Constraints
  1. System Interface Definition
  1. Create Short URL API
  1. Redirect API
  1. Analytics API
  1. URL Management API
  1. Delete Short URL API
  1. Database Design
  1. Basic System Design and Algorithm

a. Encoding actual URL

b. Generating keys offline

  1. Data Partitioning and Replication
  1. Cache
  1. Load Balancer (LB)
  1. Purging or DB cleanup
  1. Telemetry
  1. Security and Permissions