For niche industry media publishers, ensuring that all traffic to your domain is encrypted via HTTPS is a fundamental security requirement. The HTTP Strict-Transport-Security (HSTS) response header is a key mechanism for enforcing this policy by instructing browsers to only access your host over HTTPS and automatically upgrade any HTTP attempts. This article explains the structure of the HSTS header, its core directives, and how to implement it safely to protect readers from protocol downgrades and man-in-the-middle attacks.
Understanding the Role of HSTS in Media Publishing Security
This is a hypothetical example, drawn around a fictional editor of a small trade publication covering commercial refrigeration, to show how HSTS decisions might be recorded on a launch checklist.
The editor’s launch checklist for a new domain has a security section with three items: “header draft,” “rollout stage,” and “fallback note.” For the header draft, the working entry reads: max-age=300, includeSubDomains off, preload off. The short max-age is deliberate, because the editor wants a low-risk first step while the site’s subdomains are still being mapped. The rollout stage entry reads: “phase one, apex only; review after two weeks.” The fallback note reads: “if HTTP still serves content on any host, fix redirects before raising max-age.”
A second fictional publisher, this one running a directory of regional food suppliers, keeps a launch form with fields for “canonical host,” “redirect rule,” and “header value.” Two example records show how the form is used. The first record is for a listings subdomain: canonical host set to the www form, redirect rule “301 from HTTP,” and header value marked “pending, apex confirmed first.” The second record is for a static archive host: canonical host left blank, redirect rule “not yet applied,” and header value “omit until TLS certificate covers all names.”
When choosing between raising max-age immediately and staging it, the editor in the first example picks staging. The reason is concrete: one department subdomain still answers on plain HTTP, and a long max-age would lock browsers into a rule the publisher cannot yet satisfy everywhere.
These are invented illustrations for explaining the header, not records of a real launch, a real domain, or a completed configuration review.
Syntax and Core Directives of the Strict-Transport-Security Header
The header's documented syntax uses a response header named Strict-Transport-Security with a max-age directive expressed in seconds. MDN shows three forms: max-age alone; max-age with includeSubDomains; and max-age with includeSubDomains and preload.1
The max-age value is the time, in seconds, that the browser should remember the host is only to be accessed over HTTPS. includeSubDomains is optional and extends the policy to all subdomains of the host's domain. preload is also optional; when it is used, max-age must be at least 31536000, and includeSubDomains must be present.1
MDN notes that the host must send this header over HTTPS only; browsers ignore it if sent over HTTP. Setting max-age=0 disables HSTS, but only once the browser makes a secure request and receives that response.1
The editor in the refrigeration example can now turn the “header draft” line on the launch checklist into a concrete choice. A useful next action is to write out the directive as a short candidate sentence beside the field, then compare two versions: “max-age=300” for an early trial and “max-age=86400; includeSubDomains” for a later stage. The editor might note in the checklist margin which host each version would cover, so the draft stays tied to the actual publication site rather than to every domain the editor happens to own.
For the two sample fields, “header draft” could hold “Strict-Transport-Security: max-age=300” with a note reading “first week, main host only,” while “rollout stage” could hold “raise to 86400; add includeSubDomains after subdomain audit.” The editor can choose to keep both lines visible until the staged change is confirmed, rather than replacing the first entry outright.
The same three fields can serve an archived notice. Under “header draft,” the editor might record the archived value “max-age=31536000; includeSubDomains” and, under “fallback note,” write “archived page keeps old policy; no further change planned.” This shows how one set of fields can describe both a current draft and a closed historical entry without mixing their purposes.
The Function and Impact of the max-age Directive
The max-age directive states, in seconds, how long the browser should remember that a host is only to be accessed using HTTPS. Every time the browser receives the Strict-Transport-Security header, it updates the host's expiration time by adding max-age to the current time, so a fixed value can keep HSTS from expiring as each response pushes the expiration further out.1
If a host that previously sent the header later omits it, the previous header remains in effect until its expiration time. Setting max-age=0 disables HSTS, but only once the browser makes a secure request and receives the response header; by design, HSTS cannot be disabled over insecure HTTP.1
You can carry the max-age decision forward by writing it as a dated value rather than a vague intention. In the refrigeration editor's checklist, the “header draft” line could hold “max-age=300 with a note: first week, main host only,” and the same line in a later revision could read “max-age=86400 with a note: widened after the department subdomain completes its redirect work.” The number and its companion note belong together; without the note, a later reader cannot tell whether the value was a starting point or a final setting.
For a comparison you might keep two candidate values side by side and draft a one-line reason for each. A short max-age such as 300 seconds can suit an early launch where you still expect host changes, while a longer value such as 31536000 seconds suggests you are confident the host setup will not shift. Neither choice is forced; record which one you pick and why, in your own words, so the reasoning stays attached to the number.
When you revisit the archived version of the same notice, the fields still work. Under “header draft,” you might paste the old value “max-age=31536000; includeSubDomains” and add a note that this reflected the setting at the time of archiving, not a current recommendation. You can decide separately whether that archived entry needs a “superseded by” note pointing to the newer line.
Applying includeSubDomains to Protect All Site Sections
OWASP's HSTS cheat sheet states that without the includeSubDomains directive, an HSTS policy does not extend to a domain's subdomains. It gives a header example with max-age set to two years, equal to 63072000 seconds, and explains that this value applies only to the issuing host.2
The sheet presents includeSubDomains as useful if all present and future subdomains will be HTTPS, and calls this option more secure. It also states that includeSubDomains blocks access to certain pages that can only be served over HTTP. Because cookies can be manipulated from subdomains, the sheet says omitting includeSubDomains permits cookie-related attacks that HSTS would otherwise prevent by requiring a valid certificate for a subdomain.2
For an initial rollout, the sheet shows a short max-age of 86400 seconds together with includeSubDomains, in case of mistakes.2
The editor in the refrigeration example can turn the includeSubDomains choice into a recorded decision before the header goes live. A practical action is to add one line under “header draft” naming every host that should inherit the policy, written as a plain inventory: main host, department subdomain, archive subdomain, and any staging host kept on a separate name. This inventory becomes the basis for deciding whether the directive belongs in the first draft or a later stage.
You can also make the choice visible by pairing each host with a status note. For example, “main host — covered,” “archive subdomain — covered,” “staging host — excluded, separate name.” The reason column matters more than the label, since a staging host on its own registered name may not need the directive at all. If the inventory shows only one host, includeSubDomains changes little; if several exist, the note makes clear what the directive commits the publisher to.
For the archived entry, the same fields can hold the value actually used at that time, with a dated note about which hosts were listed. Comparing the launch entry and the archived entry side by side lets the editor see whether the host inventory grew without the directive being revisited.
Gradual Deployment Strategies for Initial Rollout
The deployment guidance on the HSTS Preload List Submission page suggests ramping up the max-age in stages, and it gives three header values for that ramp: 5 minutes with max-age=300 and includeSubDomains, 1 week with max-age=604800 and includeSubDomains, and 1 month with max-age=2592000 and includeSubDomains. The page says to add the Strict-Transport-Security header to all HTTPS responses and to use these values in order.3
During each stage, the page says to check for broken pages and monitor site metrics such as traffic and revenue, fix any problems that come up, and then wait the full max-age of the stage before moving on — for example, waiting a month in the last stage. If a group of employees or users can beta test the deployment, the page suggests trying the first few ramp-up stages on those users, then going through all stages for all users, starting over from the beginning.3
You might start by adding two dated rows to the refrigeration editor's launch checklist, one for the current header and one for the archived notice, so the rollout stage is visible at a glance. In the current row, the “rollout stage” field could read “week one, short max-age on main host, no subdomains,” while the “fallback note” says “confirm the canonical host redirect before raising the value.” In the archived row, the same fields might read “final value retained as published” and “superseded; kept for comparison.”
You can then add a third field, “change trigger,” with a filled example such as “after the redirect from the plain host is confirmed across the section fronts.” This is a hypothetical note, not a measured result, but it gives the launch decision a reason you can revisit later.
Consider keeping one candidate comparison beside those rows. You might write “Candidate A: seconds-level max-age — easier to withdraw if a section host breaks” next to “Candidate B: longer max-age — fewer repeat decisions once hosts settle,” then circle whichever one your checklist supports.
Addressing Common Threats Mitigated by HSTS Enforcement
The OWASP Cheat Sheet states that HSTS addresses a user bookmarking or manually typing the plain-HTTP form of a host and then being subject to a man-in-the-middle attacker; the header automatically redirects HTTP requests to HTTPS for the target domain. The same source lists a second case: a web application intended to be purely HTTPS that inadvertently contains HTTP links or serves content over HTTP, which the header again redirects to HTTPS for that domain.2
A third threat the source names is an attacker intercepting a victim's traffic with an invalid certificate in the hope the user accepts it. For that case, the source says HSTS does not allow a user to override the invalid certificate message. The source also notes that omitting includeSubDomains permits a range of cookie-related attacks from subdomains, and that setting the secure flag on all cookies prevents some, but not all, of the same attacks.2
You can take the refrigeration editor's launch checklist and turn the threat section into a short, dated record you control. Start with one line naming the threat you are guarding against — a plain-HTTP request for a section front, a mixed-content image on an archive page, or a stale link from an old newsletter — and note which host it affects. You might choose only the threat you can actually describe from your own past publishing, rather than listing every possible risk.
Next to that line, write the header decision that answers it, in plain words: "header draft: max-age=300, main host only" or "archived notice: max-age=31536000; includeSubDomains, used at time of publication." Add a fallback note, such as "if a section host breaks, withdraw the current value and record the date." These are invented sample values for a hypothetical checklist, not a record of any real launch.
Keep the same three columns for an archived notice so you can compare later. Under "header draft," you might enter the old value with a note reading "as published, 3 years ago," and under "change trigger," "after the newsletter redirect was confirmed." Reading the two rows side by side lets you see what changed and why, without implying the older entry was wrong.
Frequently asked questions
If I am comparing two possible max-age values, how might I keep them side by side and note a reason for each?
For a comparison you might keep two candidate values side by side and draft a one-line reason for each. A short max-age such as 300 seconds can suit an early launch where you still expect host changes, while a longer value such as 31536000 seconds suggests you are confident the host setup will not shift.
How can I record which hosts should inherit the policy under the header draft line?
The editor in the refrigeration example can turn the includeSubDomains choice into a recorded decision before the header goes live. A practical action is to add one line under “header draft” naming every host that should inherit the policy, written as a plain inventory: main host, department subdomain, archive subdomain, and any staging host kept on a separate name.
If I want to note which hosts were listed when an archived entry was used, how can I do that?
For the archived entry, the same fields can hold the value actually used at that time, with a dated note about which hosts were listed.
Strict-Transport-Security header - HTTP | MDN . Retrieved 2026-11-21. ↩︎ ↩︎ ↩︎ ↩︎ ↩︎
HTTP Strict Transport Security - OWASP Cheat Sheet Series . Retrieved 2026-11-21. ↩︎ ↩︎ ↩︎ ↩︎ ↩︎
HSTS Preload List Submission . Retrieved 2026-11-21. ↩︎ ↩︎