Skip to content

Commit

Permalink
Added 2 extra sections - Dan comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jeoffreyfischer authored Oct 29, 2024
1 parent 78eb23a commit 70c519e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion rules/key-principles-of-rest-api-design/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,19 @@ For example, aovoid using messy query patameters such as `api/products?user_id=1

Implement rate limiting to control the number of requests per user within a time frame, protecting the API from abuse and ensuring fair resource usage.

Provide appropriate status codes and messages (e.g., `HTTP 429`) when limits are reached to inform users clearly.
Provide appropriate status codes and messages (e.g., `HTTP 429`) when limits are reached to inform users clearly.

## Extra tip - Caching

Implement caching for frequently requested data to reduce server load and response times, enhancing the user experience. Cache static data responses at the client or server side where appropriate, especially for resources that don't change frequently.

Use HTTP cache headers like `Cache-Control` and `ETag` to guide clients on when to use cached data or refresh it, balancing speed and data freshness.

## Extra tip - Compression

Enable compression for API responses, especially for large data payloads, to reduce bandwidth and improve loading times.

Use GZIP or Brotli compression formats, which are widely supported and effective in reducing data sizes.

---

Expand Down

0 comments on commit 70c519e

Please sign in to comment.