Skip to content

Add Shopify-Theme as a cacheable header#91

Open
yoavweiss wants to merge 1 commit intomainfrom
shopify_theme_header
Open

Add Shopify-Theme as a cacheable header#91
yoavweiss wants to merge 1 commit intomainfrom
shopify_theme_header

Conversation

@yoavweiss
Copy link
Member

@yoavweiss yoavweiss commented Sep 26, 2025

As outlined in https://shopify.slack.com/archives/C098UMNCU3A/p1758527247056459, I think we need a different mechanism than the Speculation-Rules header to distinguish Horizon themes in cache hits.

This PR adds a Shopify-Theme header to the cacheable headers. Once that happens, we can add such a header in SFR for cache misses that match the Horizon theme detection, and use it on cache hits to inject Horizon-specific speculation rules.

There's a related PR on the SFR side: https://github.com/shop/world/pull/199868
It adds the use of this header as part of the speculation rules logic.

@yoavweiss yoavweiss requested a review from a team as a code owner September 26, 2025 06:19
Copy link

@andheiberg andheiberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What sets this header? I can't see it being set ever.

Even on cache miss we do now the current theme I believe as basic shop is fetched. So I'm not sure we need a header at all?

@yoavweiss
Copy link
Member Author

What sets this header? I can't see it being set ever.

Apologies. I should've added https://github.com/shop/world/pull/199868 to the description

Even on cache miss we do now the current theme I believe as basic shop is fetched. So I'm not sure we need a header at all?

The goal here is to know the theme on a cache hit without having to query the DB

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.

3 participants

Comments