Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ pre: `uninstall-pre`, post: `uninstall-post`
pre: `caching-pre`, post: `caching-post`

- Enable Cache Components in `next.config.ts`
- Define the cache lifetime profiles and the caching on/off switch
- Implement caching in appropriate components/actions
- Implement Suspense boundaries and fallbacks
- Memoize various lookups per-request
Expand Down
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Changelog

## 1.1.1

_Based on Next.js 16.2.9_

### Summary

Consolidated the caching configuration into a single module. The lifetime
profiles and the switch that enables caching moved out of `next.config.ts`
into `lib/cache/cache-profiles.ts`, and the environment variable that
controls caching was renamed from `CACHE_COMPONENTS_ENABLED` to
`CACHE_ENABLED`. Caching behavior is unchanged. No lab or enhancement was
added, removed, or renumbered.

This is groundwork for hosting the app on Cloudflare Workers, which cannot
run Cache Components: the staged-render path corrupts streamed HTML there
(see opennextjs-cloudflare#1225). A Cloudflare build has to cache at the
fetch level instead, so the parts of the caching setup that don't depend on
where caching attaches now live in one module that both approaches can
share.

### Changes

- Added `lib/cache/cache-profiles.ts`, holding the `standard` and `extended`
lifetime profiles, the zero-second profile used when caching is off, and
the `cacheProfile()` lookup each `use cache` boundary now calls. `cacheLife`
accepts an inline `{ stale, revalidate, expire }` object as well as a named
profile, so the `cacheLife` block and its helpers were removed from
`next.config.ts`. Folded into the caching enhancement, which is where the
module is introduced.
- Added a `CacheLifetimeProfile` interface and `CACHE_PROFILE_STANDARD` /
`CACHE_PROFILE_EXTENDED` constants, so profiles are typed and selected by
constant rather than by a bare string. All three lifetime fields are
required, unlike Next's own `CacheLife`, where each is optional.
- Renamed `CACHE_COMPONENTS_ENABLED` to `CACHE_ENABLED`. The old name
described the `cacheComponents` flag it worked around; the variable now
simply turns caching on and off. Folded into the caching enhancement's
step, alongside the `.env.example` entry.
- Converted the `cacheLife` call sites in the customers and App Extension
enhancements to the new `cacheProfile()` form, each folded into the code
commit that introduced that call.

## 1.1.0

_Based on Next.js 16.2.9_
Expand Down
4 changes: 2 additions & 2 deletions docs/TUTORIAL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Lab Tutorial: BigCommerce Single-Click App Starter

> **Based on version 1.1.0** — this tutorial corresponds to the latest
> progressive history tagged `1.1.0`.
> **Based on version 1.1.1** — this tutorial corresponds to the latest
> progressive history tagged `1.1.1`.

This document lists the lab exercises and their step-by-step diffs. Each
main-lab step links to a comparison between the step's `*-pre` (TODO
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starter-sc-app-next",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"packageManager": "pnpm@11.5.0",
"engines": {
Expand Down
1 change: 0 additions & 1 deletion src/lib/cache/cache-profiles.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// The app's cache lifetime profiles, and the switch that turns caching on and
// off. Every `use cache` boundary selects one by calling
// `cacheLife(cacheProfile(CACHE_PROFILE_STANDARD))`.
//

// A cache lifetime, in seconds. Structurally compatible with Next's own
// CacheLife type, but all three fields are required: every profile here sets
Expand Down