Mobile application developers often struggle with balancing network efficiency and data freshness when serving static content. This article addresses the specific question of which Cache-Control directives ensure optimal caching behavior for static assets. We will examine standard HTTP caching mechanisms, focusing on how directives like public, max-age, and immutable interact with browser and intermediary caches. The discussion is limited to technical configuration based on established HTTP standards, providing actionable insights for configuring response headers effectively.
Assuming a Mobile App Team Needs to Optimize Static Asset Delivery
Suppose a mobile app team is preparing a small static configuration reference for its own image, script, and locale files. The author's desk holds a CDN export, a build-manifest screenshot, and a draft table with no header values yet. She is not optimizing live traffic; she is building a working example of what a cache-policy sheet looks like.
She starts with three candidate row names: "App shell and vendor scripts," "Campaign artwork," and "Locale bundles." Each is specific enough that a reviewer can see which files belong together. The first row covers fingerprinted JavaScript bundles whose names change on every release. The second covers promotional images that are swapped weekly but may be revisited by lapsed users. The third covers translation files that are read at startup yet change only when copy is updated.
Her draft sheet has six columns: path pattern, file type, versioning method, intended freshness, revalidation expectation, and owner. Two invented records show how entries fit. The first reads: app-shell and vendor scripts, JavaScript, content-hashed filenames, long freshness, no routine revalidation, mobile platform lead. The second reads: campaign artwork, WebP images, unhashed paths, short freshness, revalidation on each revisit, marketing engineering. The locale row is left blank in this draft, which the author flags as unfinished rather than treating as a default.
She makes one deliberate trade-off. For the content-hashed scripts she places the freshness value in the response header rather than a meta element, reasoning that a response header applies before the body is parsed and keeps one policy across files. For the unhashed artwork she accepts more frequent revalidation because a stale promotion is more visible to users than an extra request. She notes that the metadata tag approach would require editing each page and could drift from what the server sends.
Every item on the sheet is a self-authored example meant to explain the problem, not a record of a real deployment, a completed trial, or measured user behavior. The author keeps the table unscored so the reader can substitute their own path patterns and owners without inheriting untested values.
Understanding Basic Storage Requirements for Cached Responses
RFC 9111 states that a cache must not store a response to a request unless several conditions hold. Among them: the request method must be understood by the cache, the response status code must be final, and, if the status code is 206 or 304 or the must-understand directive is present, the cache must understand that status code. The response also cannot contain the no-store cache directive.1
For shared caches, RFC 9111 adds that the private response directive must be absent or must allow a shared cache to store a modified response, and the Authorization header field must be absent unless a response directive explicitly allows shared caching.1
The response must additionally contain at least one of: a public response directive, a private response directive when the cache is not shared, an Expires header field, a max-age response directive, an s-maxage response directive for shared caches, a cache extension allowing storage, or a status code defined as heuristically cacheable.1
You can turn the six-column draft table into a working cache-policy sheet by starting with the final column, owner, because that decision determines whether an entry belongs to app release engineering or to the web content team. For the content-hashed scripts row, note the build tool that produced the hash and the release tag it shipped with; for the app shell and vendor scripts row, record the version constant embedded in the app binary. The blank freshness cell can stay blank until you decide whether revalidation should happen at launch, on a schedule, or only on error.
Consider adding a seventh column, labeled evidence, that holds the location of the CDN export line or build-manifest entry that supports the row. A filled example: path pattern /static/app/*.abcdef12.js, file type JavaScript, versioning content hash, intended freshness one year, revalidation expectation none, owner release engineering, evidence build-manifest line 14. The same fields work for an archived entry if you replace the path pattern with the retired bundle name and state the date the file stopped being referenced.
You might also mark each row as current or retired in a short status column so the sheet remains useful after a release cycle. This is a choice you can make now, before more rows accumulate.
Applying Public and Max-Age Directives for Shared Caching
The public response directive indicates that a response can be stored in a shared cache such as a proxy or CDN. For static assets, the example combines a long max-age value of 31536000 with immutable, applied to an assets path, so caches treat the content as unchanged while fresh.2
The max-age directive sets how long a response stays fresh, counted from generation on the origin server rather than from when a cache received it. A stored Age value is deducted from that lifetime. A negative or non-integer max-age makes caching behavior unspecified, and caches are encouraged to treat the value as 0.2
For shared caches specifically, s-maxage overrides max-age and any Expires value, and private caches ignore it. Standard guidance also calls for adding private to user-personalized content, especially responses after login, because without it a shared cache could reuse that response for multiple users.2
For the four working rows on her draft sheet—the app-shell scripts, campaign artwork, locale bundles, and a retired icon set—she can now fill the header-value cells as a short authored example. A versioned script row might read public, max-age 31536000, with the filename carrying the hash; an artwork row might read public, max-age 604800 because the campaign changes weekly; a locale row might read public, max-age 86400 to keep translations reasonably fresh. The retired icon row can keep the same directiveness but sit under a retired label, so archived entries are not mistaken for live policy.
She might write a brief note beside each value explaining why shared caching is acceptable: the content is identical for all users and governed by a versioned filename or planned release. That note lets a reviewer challenge the choice without re-reading the whole sheet.
If a row covers content that must not be stored by intermediaries, she can mark it private in the same cell and record the reason, keeping contrasts visible in one column. She can also choose to leave a cell blank where the intended freshness is still undecided, rather than guessing a number. The point is a readable working example, not a finished policy.
Using Immutable Directive for Versioned Static Resources
For versioned static resources, the page describes a cache-busting pattern: include a version or hash in the URL and never modify the resource, instead publishing new versions at new URLs when changes are needed. With long max-age and immutable set together, as in the example value max-age=31536000, immutable, caches are told the response will not be updated while fresh.2
The page states that even when a user reloads the browser, conditional revalidation requests for such static resources are unnecessary because they are never modified; immutable avoids those requests while the response is fresh. When the library or image is updated, new content should get a new URL so cached copies are not reused.2
For the versioned static resources already listed on your sheet, you can now decide which rows deserve the immutable directive by asking one question: does the filename or query value change whenever the bytes change? Consider the app-shell scripts row, where the build manifest shows a content hash in each filename. If you confirm that pattern holds, you might mark immutable in the header-value cell and note the hashed filename beside it as your reason. Do the same for locale bundles only if their paths carry a version segment you control.
Campaign artwork is the useful contrast. If its path stays fixed while the image is swapped each season, immutable would pin stale images in caches, so you might leave it out and record the seasonal path instead. A retired icon set can also be excluded or marked retired, with a short note that it no longer ships.
Your evidence column can hold the manifest line or export row that shows the version token, so a reviewer can check the choice without rerunning anything. These remain your own examples; you can adjust which rows qualify as your build setup changes.
Handling Authorization Headers and Private Content Restrictions
RFC 9111 states that a shared cache must not store a response to a request carrying an Authorization header field unless the response contains a Cache-Control response directive that explicitly allows shared caching, and the cache conforms to that directive's requirements. The specification names must-revalidate and public among the directives with that effect.3
The same document lists an additional storage condition for shared caches: the private response directive must either be absent or permit a shared cache to store a modified response. It also requires that no-store not be present in the response and that the response contain at least one directive or field enabling storage, such as public, an Expires field, or a max-age response directive.3
Its security considerations section addresses caching of sensitive information, and its section on storing responses to authenticated requests is the place to check whether a given response qualifies.3
For the rows on your sheet that involve authenticated or user-specific responses, you can add a short handling note beside the existing owner and evidence columns rather than creating a separate table. A useful field pair is “who may store it” and “what the header should say.” An invented example: a row for a signed-in user’s profile JSON might read “shared caches: no; header note: private, with a reason that the body varies by account.” Place that note next to the versioning method so the contrast with your static rows stays visible.
You might also record what must never appear in a shared cache and why, phrased as your own working reminder. For instance, beside a locale bundle row you could write “identical for all users, safe to share,” while beside a token-refresh response you could write “per-user, keep out of shared storage.” These are author examples for your draft sheet, not measured results or vendor guidance. Deciding which rows carry such notes is your call, and you can leave a row blank if you are still unsure.
When a response mixes public and private content, consider splitting it into two rows on your sheet so each row names a single caching intent. The evidence column can then point to the manifest line or export row that shows which files belong to which group, letting a reviewer follow your reasoning without repeating any check.
Configuring Must-Understand for Fallback Behavior
For fallback behavior, the documented guidance couples the must-understand directive with no-store: a response carrying both directives is stored only by caches that support must-understand, while caches that do not support it ignore that directive, and the presence of no-store means the response is not stored. In the documented example, a cache that supports must-understand stores the response with an understanding of cache requirements based on its status code.2
The same source separates related fallback and revalidation directives by scope. The no-cache response directive permits storage but requires validation with the origin server before each reuse, and the source notes it does not mean "don't cache." The proxy-revalidate directive is described as the equivalent of must-revalidate for shared caches only. The source also notes that must-understand and no-cache do not guarantee revalidation for history navigations, and that major browsers do not support the max-stale or min-fresh request directives.2
For the fallback rows on your sheet, you can now decide what should happen when a requested asset is missing or when a header value cannot be confirmed. A practical next step is to add a short fallback column beside each existing row, then fill it with the action you would take: serve a default file, let the request pass through without a shared-cache hint, or point to a prior versioned path. A filled example might read "locale bundle, missing bundle, serve default locale, owner: web team."
Consider writing the fallback as a plain sentence rather than a single word, so the reason survives later edits. Beside the campaign artwork row you might write "if the season image is absent, serve the previous hashed path and keep the old date." This keeps the choice readable for a teammate who has not seen the build manifest.
You can also mark which fallbacks are temporary. A short note such as "until the next release" or "permanent for this path" tells a reviewer whether to revisit the row later. These entries are your own working examples, not measured results or confirmed behaviour, so phrase them that way when you share the sheet.
Frequently asked questions
What three candidate row names does she start with when organizing her draft?
She starts with three candidate row names: "App shell and vendor scripts," "Campaign artwork," and "Locale bundles." Each is specific enough that a reviewer can see which files belong together.
Which column should you start with to turn the six-column draft table into a working cache-policy sheet?
You can turn the six-column draft table into a working cache-policy sheet by starting with the final column, owner, because that decision determines whether an entry belongs to app release engineering or to the web content team. For the content-hashed scripts row, note the build tool that produced the hash and the release tag it shipped with; for the app shell and vendor scripts row, record the version constant embedded in the app binary.
What short status column might you add to mark each row as current or retired?
You might also mark each row as current or retired in a short status column so the sheet remains useful after a release cycle.