Event websites often serve high volumes of static assets like CSS, JS, and images. This article explains how to set cache expiration rules to balance performance and content updates.

Scenario: Preparing Static Assets for an Upcoming Conference

Imagine a conference web author preparing a static asset checklist a week before registration opens. The checklist names three groups: “Style and Script,” “Images and Fonts,” and “Program Files.” Under Style and Script the author lists the main stylesheet, a JavaScript bundle, and a small theme toggle file. Under Images and Fonts sit the header logo, speaker thumbnails, and a pair of web fonts. Program Files covers the agenda page, a printable schedule, and a venue map.

The author drafts one checklist row per item with fields for file path, content type, chosen Cache-Control value, and a fallback note. Two invented records show how the rows are used. Record one: path /assets/css/site.css, content type text/css, Cache-Control public, max-age=31536000, immutable, fallback note “query-string version for emergency edits.” Record two: path /program/agenda.html, content type text/html, Cache-Control public, max-age=600, must-revalidate, fallback note “short freshness while session titles settle.” These are self-made examples for explaining the problem, not records of a real prior event.

The author debates whether speaker thumbnails belong with fonts or with images. The tradeoff is practical: thumbnails change more often as speakers are confirmed, so placing them in Images and Fonts with a one-day max-age makes updates easier, while the logo and fonts can keep a long max-age. The author picks that split and notes the reason beside the row rather than trusting memory.

For the program files, the author keeps the HTML short-lived and adds a separate row for a hashed printable schedule, treating it as a stable file with a long max-age. The checklist also carries a column for who edits each file and a column for the link destination used in a pre-event announcement: the announcement page points to the agenda path, while an internal notes page points to the printable schedule path. Those destinations are fixed in the checklist so the author can trace which asset each message references.

None of this is presented as a completed trial or a measured outcome. It is a hypothetical working draft showing how a small set of files, two sample records, and one documented choice can turn the caching question into something concrete to review before the conference site goes live.

Understanding Default CDN Caching Behavior

Default behavior in the CDN described by the source depends on whether a resource matches a console cache rule. If the origin sends Pragma: no-cache, or Cache-Control: no-cache, no-store, or max-age=0, the node follows the origin and does not cache it. If a console rule matches and the origin has not set those no-cache directives, that rule takes priority.1

When no console rule matches, or a matched rule is set to follow the origin, the CDN follows the origin's response headers. The source orders these by priority: Cache-Control first, then Expires, then Last-Modified, then ETag. Within Cache-Control, the CDN uses s-maxage for CDN cache duration before max-age.1

If neither a console rule nor an origin cache header applies, the CDN does not cache. The source also states that the CDN applies caching only to origin responses with status codes 200, 203, 206, 300, 301, 308, and 410; other codes, such as 404, need separate handling.1

You can turn the checklist row into a pause before choosing a value: note the audience impact if the file is stale, then mark a row as “hold,” “confirm with owner,” or “reuse two weeks ago” rather than forcing every file into the same setting. The useful action is not to settle a default today but to record which rows cannot safely share one choice.

Try filling one row for a short-lived program page with a field label, a draft note, and a decision. For example, “agenda page — schedule details may flip after a room change — hold, revisit after final program” sits differently from “printable schedule — stable once published — reuse two weeks ago.” The same fields can serve archived entries: “previous agenda — no longer updated — confirm with owner,” with the decision written as “reuse two weeks ago” only if that older entry still matches what you intend to keep. If it does not, write “hold” and leave the row for a later pass.

You might make the decision column a small set of ordinary words rather than a single yes or no, so a row can say “hold” without pretending the question is closed. These are hypothetical examples for shaping your own notes, not a result from any outside test.

Configuring Cache Expiration Rules by Path or Extension

The console lets a rule target either a directory or a file extension. For a directory, the address begins with a slash, such as /static/, and matches all resources under it; a single slash matches all paths, and each rule accepts only one directory. For a file extension, enter one or more suffixes separated by English commas, such as jpg,png,css; matching is case-sensitive and vertical bars or other symbols are not supported.1

When several rules match the same resource, the rule with the higher weight, from 1 to 99, wins. If weights are equal, the earlier-created rule wins, and once a request hits a rule, matching stops. The documentation recommends high weights for specific paths or suffixes and a low weight for the root path. An expiration time ranges from 0 seconds to 3 years.1

You can start with the path or extension you already know your asset uses, then decide whether that clue is specific enough to set one expiration rule for the whole group. For the main stylesheet, a path ending in .css may cover several pages at once, so you might note that shared scope in your checklist before choosing a value. A small theme toggle file might share the same extension but change more often; you can decide whether to split it into its own row or keep it with the stylesheet and accept a shorter expiration for both.

The images and fonts group rewards a closer look. The header logo and speaker thumbnails may both be image files, but their change patterns differ, so you might give each its own row and compare the audience impact if a stale copy appears. Web fonts often change rarely, which could justify a longer value in your draft. None of these choices needs to be final now; mark each row “hold” or “confirm” if the path alone does not settle the question.

For program files, you can use the extension as a first filter, then refine by file role. A printable schedule and a venue map may both be static files, but the schedule may change more often; you might test a short-lived and a long-lived draft side by side and note which audience group each one serves.

For static resources that update infrequently, such as images and installation packages, the source recommends a cache duration of at least one month. For frequently updated static resources such as JS and CSS, it recommends a shorter duration, for example 1 to 7 days. Dynamic content such as PHP or JSP is suggested at 0 seconds, meaning no caching. The configurable expiration time ranges from 0 seconds to three years.1

For the style-and-script group, you can start by asking whether each file's name changes when its contents change. The main stylesheet and the JavaScript bundle are candidates for a longer max-age, but only if you can confirm your build process adds a content hash to their names. If you are not sure, consider a shorter value for now and record why in your notes. The theme toggle file deserves its own row: if it is small and changes with each release, a short max-age may suit it better than the bundle's value.

You might apply the same question to images and fonts. The header logo and web fonts are plausible long-lived entries when their file paths are versioned; speaker thumbnails may sit in a middle band because they can be replaced as the lineup is confirmed. As a demonstration, one row could read "speaker photo — path changes on replacement — medium max-age — reason: lineup may shift." For program files, a sample agenda page row might say "agenda — HTML — short max-age — reason: schedule details may flip before the event."

Consider keeping these as draft choices rather than settled rules. You can write a one-line reason beside every value, then revisit the rows once registration opens and see which files actually changed.

Handling Source Station No-Cache Directives

When the source station sends Cache-Control: no-cache, no-store, or max-age=0, or sends Pragma: no-cache, the CDN follows the source directive by default rather than caching. The documented effect differs by directive: no-store blocks caching entirely and every request pulls the full resource from the source station; no-cache or max-age=0 still lets the node keep a cached copy but requires revalidation before each use, and a passing validation returns 304 without a body, so origin request counts do not drop but each costs only a small conditional request.2

The same page names two possible responses to this situation: enable the setting that ignores source no-cache headers so the console cache rules apply, or change the source configuration to remove the no-cache directives for static resources. A separate note warns against setting the expiry time to 0 seconds globally for static resources, since that sends every request back to the origin.2

When the source station answers with a no-cache directive, you can decide separately whether your static copy should still carry a chosen Cache-Control value. You might record the origin response in the same checklist row, then note your own value beside it, so the two signals stay visibly different rather than silently merged.

For the main stylesheet, a draft row might read: field label “origin response,” value “no-cache observed,” then a second field “my draft header,” value “long max-age with a versioned filename.” A contrasting row for the agenda page could pair “no-cache observed” with a short max-age and a revalidation note. These are hypothetical examples, and you can choose whether either value is appropriate for your own files.

You might also keep a third column labeled “decision” and fill it with an ordinary word such as “hold” or “revisit,” rather than treating the origin header as an instruction you must copy outward. The choice remains yours; the row simply makes your reasoning visible before registration week arrives.

Verifying Cache Hits via Response Headers

Use a GET request to inspect response headers, because a HEAD request may not trigger the node's actual caching logic and can falsely appear as a miss. Check X-Cache: HIT means the response was served from cache, while MISS or a missing field means the request went back to the origin. Age gives the seconds the resource has been cached; pair it with X-Cache, since MISS with Age 0 confirms origin retrieval and HIT with Age 0 means it was cached less than one second ago. X-Swift-CacheTime is the total allowed cache time, and remaining time equals X-Swift-CacheTime minus Age.2

You can take one existing checklist row — say the program page’s HTML — and extend it with a “verify later” field that records what a response header check should show, without treating that note as a result now. For that row, a draft entry might read: field label “expected response header,” value “short cache lifetime for the page,” and a separate “check date” left blank.

You might then copy that field pattern onto a second row, such as the hashed printable schedule, where the expected value would be a long lifetime. Writing these two entries side by side lets you compare whether your chosen values follow the change patterns you already noted for each file.

For style and script files, consider adding a short “what a stale copy would look like” note to the same row. A draft note for the main stylesheet might say “old colors persist after an update,” while the theme toggle could say “visitors keep the previous switch state.” These are your own wording choices, not confirmed observations.

You can decide the order in which you will check headers once the site is live: which asset group feels most urgent, and which rows you are content to leave as draft. Keep the verify field distinct from your chosen value so a planned check is never mistaken for a measured outcome.

Frequently asked questions

How does the author set up each row of the checklist?

The author drafts one checklist row per item with fields for file path, content type, chosen Cache-Control value, and a fallback note. Two invented records show how the rows are used.

Why might you give the header logo and speaker thumbnails separate rows even though both are images?

The images and fonts group rewards a closer look. The header logo and speaker thumbnails may both be image files, but their change patterns differ, so you might give each its own row and compare the audience impact if a stale copy appears.

Where do you add a note about what a stale copy would look like, and what might that note say?

For style and script files, consider adding a short “what a stale copy would look like” note to the same row. A draft note for the main stylesheet might say “old colors persist after an update,” while the theme toggle could say “visitors keep the previous switch state.”