Skip to content

[GSSoC26] feat: Add cache-control headers for product listing#452

Open
ashrion wants to merge 1 commit into
Nsanjayboruds:mainfrom
ashrion:feat/cache-control-headers
Open

[GSSoC26] feat: Add cache-control headers for product listing#452
ashrion wants to merge 1 commit into
Nsanjayboruds:mainfrom
ashrion:feat/cache-control-headers

Conversation

@ashrion

@ashrion ashrion commented Jul 11, 2026

Copy link
Copy Markdown

Description

This PR adds cache-control headers to the product listing endpoint to improve performance through caching.

Changes

  • Added Cache-Control: public, max-age=300, stale-while-revalidate=60 header
  • Added Vary: Accept-Encoding header
  • Products are relatively static data suitable for caching

Motivation

  • Product listing is frequently accessed but rarely changes
  • Caching reduces database load and improves response times
  • Stale-while-revalidate allows serving cached content while fetching fresh data

Testing

  • Request /api/product/list and verify Cache-Control header is present
  • Verify response is cacheable by browsers and CDNs
  • Verify stale content is served while fresh data is fetched

Closes #451

GSSoC26 contribution

- Add Cache-Control: public, max-age=300, stale-while-revalidate=60
- Add Vary: Accept-Encoding header
- Improves performance by allowing client and CDN caching
- Products are relatively static data suitable for caching

GSSoC26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GSSoC26] feat: Add cache-control headers for product listing

1 participant