The content has not changed and the page is still slow, check the max-age and s-maxage of the cache headers first.

📅 2026-10-13 👁️ 17

The content has not changed but the page still loads slowly, should the cache control header check max-age or s-maxage first? First, clarify the hierarchy and then discuss the order: max-age manages the freshness period of the response in private caches like browsers, while s-maxage only manages shared caches like CDN, and it will override the max-age value for shared caches.If your users are saying 'I open slowly', the first step is to check max-age; if all users are slow and the source site load is normal, the first step is to check s-maxage and shared cache hit status.The real answer is not either/or, but first locate where the slow occurs.

First determine if the slow is in transmission or rendering

In the network panel of the browser developer tools, look at two numbers: the time to first byte (TTFB) and the total download time. TTFB is large, slow on the server or chain, it belongs to the problem that needs to be solved by the cache header; TTFB is normal but the total time is dragging, slow in terms of resource volume and quantity, it is a matter of rendering side, changing the cache header is not useful. This step is wrong in direction, and any further detailed search is in vain. Take a look at the comparison after a hard refresh: a hard refresh bypasses local cache, if a hard refresh is明显 slower, it means that the browser cache has been working for you, the problem is concentrated on the first visit or shared cache layer.

Looking from the browser side at max-age

The semantics of max-age as defined by the standard is: the response remains fresh for N seconds after its creation. It only answers whether the browser is willing to use the locally stored copy directly.Content does not change but is slow, there are three common problems: the max-age value is too short, it always returns to the origin negotiation every time it is opened; The response is simply without cache instructions, the browser handles it heuristically, and the behavior is uncontrollable;There is a no-store interface call mixed in, turning reusable data into a full download every time. The action is to check the Cache-Control header in response headers resource by resource, separating the evaluation of static resources and document requests, and the freshness period of static resources should be significantly longer than that of documents.

Looking from the shared cache side at s-maxage and no-store

When the site is behind a CDN or enterprise gateway, pay special attention to s-maxage: it indicates the duration for which the response remains fresh in the shared cache, the private cache ignores this directive, but it overrides max-age for the shared cache.This means a typical accident: you reduced the max-age to make the content update as soon as possible, but s-maxage is still holding a long-old value, and the user still sees the old cache.Reverse the s-maxage is too short, CDN is as good as non-existent, each request is pushed back to the source, and everyone becomes slower. There is also a more severe killer, no-store - any type of cache is not allowed to store this response, once mistakenly attached to the document route, CDN and browser will all fail, and the source station will bear all the visits.Check such issues by following the routing order from 'user to origin server': browser, shared cache, origin server, only asking if the instructions at each level are correct.

At the origin server, confirm the static file and backup range

Troubleshooting at this level of the source station, the problem often changes from 'cache header' to 'source station itself slow': is the page rendered dynamically every time, have the static files truly become static products, and is the database query using an index.The degree of staticization of the content management system directly determines the response speed of the source site. Only sites with this layer problem-free are worth continuing to tweak the cache header seconds. Additionally, there is a check that is often confused but unrelated to caching: if 'slowdown' occurs after a migration or recovery, first confirm whether the backup range is complete - whether the backup and recovery of data containing static files have been verified. The recovery without static files will cause the site to generate the page that should be generated on the spot during operation, looking like cache failure.Based on Go language, AnQiCMS page loading speed is significantly improved compared to traditional PHP CMS, the official figure can carry about 5 million PV on a single machine, the confidence of the source station layer comes from this kind of architecture choice, the cache header just takes this ability further.

Common questions

Question: When max-age and s-maxage conflict, whose side should be listened to?Answer: The shared cache listens to s-maxage and overrides max-age; the browser's private cache ignores s-maxage and only recognizes max-age.

Question: How should the cache headers be configured for a column with frequently updated content?Answer: The document layer is configured with a short freshness period, and static resources are given a long freshness period. After updating, it relies on active link push and sitemap to allow search engines to quickly get the new version.

Question: When is 'no-store' appropriate?Answer: Responses such as login status private data, payment receipts, and the like; attaching them to ordinary document or resource routes is a performance issue.

Related articles

After the site-wide replacement changes the column name, should the anchor text and pseudo-static rules follow?

The site-wide replacement can change keywords and links in the main text in one go, but it only covers the content text layer: column names and address forms belong to the structure and routing layer. After the change, the keywords in the anchor text library and the matching paths of the static rules may not match the new address. At the end, three things need to be done - check the anchor text distribution range, review the static rules, and check the jump between new and old addresses to prevent broken links left by batch changes. Back up before changing, and keep a fallback ready.

2026-10-13

The page has been changed, but the user still sees the old version. What order should be followed from clearing the cache to verification?

The content has changed, but the front-end is still showing the old page. Most of the time, it's not that the program hasn't taken effect, but rather that the intermediate cache layer is still hitting the old copy. Investigate in three steps: first, prove false on the source station and confirm that the change has really been saved to the database; then clear the cache at an appropriate granularity, with edge nodes supporting a variety of ranges such as address, domain name, tag, prefix, and the entire site; finally, check whether the cache status header in the response has changed from a hit to a source, and confirm that there is no trace of verification through the user side. Make a backup before making batch changes and keep a fallback.

2026-10-13

What are the conventions of Disallow, asterisk, and dollar sign in robots.txt?

The two basic instructions of robots.txt are Allow and Disallow, which respectively indicate allowing or prohibiting the crawling of certain paths; the asterisk is a wildcard that can match any character sequence, and the dollar sign at the end of the line indicates that the address ends exactly at this point. This format is standardized by RFC 9309. It should be noted that it only constrains crawling behavior, does not determine whether a page can be included, and is not effective for all robots; after changing the pseudo-static rules within the site, the robots configuration needs to be reviewed to ensure that the match is still valid.

2026-10-13

Writing nofollow in robots.txt actually does not take effect, which standards recognize which fields.

The standard text for excluding by robots, the fields only include User-agent and Disallow groups, nofollow is not defined in robots.txt, and it will not be parsed according to the standard. This article distinguishes between blocking crawling and blocking inclusion: crawling is controlled by robots configuration, inclusion is based on page-level control and server-side redirect convergence, and on-site robots settings and 301 redirect each have their own responsibilities.

2026-10-13

After changing the server IP or connecting to CDN, what sequence should be followed to review resolution, certificate, and collection?

After changing the server IP or connecting to CDN, the review sequence is a three-level progression: first confirm DNS resolution (prematurely reduce TTL, check the effective range), then verify the certificate chain (check both sides of the edge and origin, align the origin protocol), and finally converge the collection side - the 301 redirect mapping cannot be interrupted, actively push the core pages to Baidu and Bing, and check the source address in the log.

2026-10-15

Guide to building multilingual sites: full-page HTML translation and SEO localization

Ensure consistency across language versions through full-page HTML translation,配合hreflang标签avoid duplicate content issues, configure independent keyword libraries for each language, and achieve true SEO localization rather than simple machine translation.

2026-10-15

Data collection maturity: From external collection to structured knowledge base

Automatically obtain information from external websites through the content collection module, combine batch import functions of ZIP compressed packages and Excel tables, utilize the duplicate checking mechanism of the /api/import/archive interface to avoid repetition, and gradually build a structured corporate knowledge base.

2026-10-15

Scheduled release and multi-version: automated management of content workflows

Automate workflow through setting the scheduled release time of content, with draft links carrying the parameter preview=true for internal preview. Deleted documents can be recovered by moving them to the recycle bin. Understand the flow rules of four states: formal documents, drafts, pending release, and recycle bin to improve team collaboration efficiency.

2026-10-15