Sub topic 15
Automated checks for drift and staleness
Assume you know basic HTML, JSON, web pages, sitemaps, and product data. This chapter focuses on monitoring. It does not replace a single source of truth or correct page rendering. It checks that those systems continue to agree.
What an audit should detect
A fact has drifted when two published representations disagree. For example, a product page may show 89.00 EUR, while its JSON-LD says 99.00 EUR. A fact is stale when it has not been reviewed or changed within an acceptable period.
Automated checks should compare:
- Visible page facts with JSON-LD structured data.
- Product records with page prices and stock status.
- Sitemap
lastmodvalues with the actual meaningful update time. - Product feeds with the site and inventory system.
- HTTP cache validators with the current page version.
- Review dates with the allowed freshness period.
A useful audit reports the fact, its sources, the difference, and the owner who must fix it.
| Check | Example failure | Typical action |
|---|---|---|
| Price consistency | Page says 89 EUR, feed says 99 EUR | Block the feed or correct the source |
| Availability | Page says in stock, JSON-LD says out of stock | Regenerate all outputs |
| Date freshness | Review is older than its policy | Assign a content review |
| Sitemap accuracy | `lastmod` predates a real update | Regenerate the sitemap |
| Cache behavior | CDN serves an old ETag | Purge or revalidate the cache |
Choose freshness rules by fact type
Not every fact decays at the same speed. A product price may need checking whenever inventory changes. A technical explanation may need review every six months. Define a maximum age for each fact type rather than using one global number.
Store the policy with the fact or content type:
from datetime import date
policies = {
"price": 1,
"availability": 1,
"product_description": 90,
"technical_article": 180,
}
last_reviewed = {
"price": date(2026, 11, 28),
"availability": date(2026, 11, 20),
"product_description": date(2026, 8, 1),
"technical_article": date(2026, 5, 1),
}
today = date(2026, 11, 29)
for fact_type, maximum_age in policies.items():
age = (today - last_reviewed[fact_type]).days
if age > maximum_age:
print(f"STALE {fact_type}: {age} days old")This check produces a warning, not an automatic date change. Changing a date merely to remove a warning is date gaming. A person or an approved data update must establish that the fact is still correct.
Compare representations, not just page status
A successful HTTP status only proves that a server returned a response. It does not prove that the response contains current facts. Fetch pages in a test environment and extract the values that matter.
Normalize values before comparing them. Convert prices to decimal numbers, currency codes to uppercase, and URLs to a consistent form. Then compare the normalized values from each source.
Set useful alerts and audit trails
Run fast checks on every content or catalog deployment. Run a full crawl on a schedule, such as daily. Keep the result of each run with the URL, check name, observed values, timestamp, and software version.
Separate failures from warnings:
- A price or stock mismatch should usually fail a release.
- A review approaching its deadline can create a warning.
- A missing optional property may be informational.
- A discontinued product should follow a deliberate redirect, removal, or archived-page policy.
Alert the owner responsible for the fact, not only the engineering team. Include a link to the failing page and the expected source value. Track when the issue was acknowledged and resolved.
Exercise
Exercise
A page shows a product as in stock, but its JSON-LD and merchant feed both say out of stock. Which source should an audit treat as authoritative, and what should happen next?
Show answer
The configured authoritative inventory record should decide. The audit should flag the disagreement, prevent inconsistent outputs from being released, and notify the inventory or catalog owner to correct the source and regenerate the page, JSON-LD, and feed.