Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why Your Static Site’s lastmod Is a Lie (And How CI/CD Shallow Clones Secretly Hurt Your SEO)

If you build static websites, documentation hubs, or content platforms using Next.js, Astro, or 11ty, there is a very high probability that your sitemap.xml is quietly lying to Googlebot every single day. It probably looks something like this: // sitemap.ts export default function sitemap (): MetadataRoute . Sitemap { return routes . map (( route ) => ({ url : `https://example.com ${ route } ` ,…

If you build static websites using Next.js, Astro, or 11ty, your sitemap.xml might be misleading search engines about your site's last modification dates. This article explores why this happens and how continuous integration/continuous deployment (CI/CD) shallow clones can exacerbate the problem.

In a CI/CD pipeline, a shallow clone is typically performed using the command `git clone --depth 1`. This means that Git only keeps track of the latest commit and does not maintain a complete history of the repository. As a result, every file in the repository is timestamped with the current time when the build is triggered, regardless of when the files were actually modified. This leads to inflated last modified dates in the sitemap.xml file.

Search engines like Google and Bingbot are not fooled by these false timestamps. When they see all URLs on a domain marked as modified on the same day, they interpret this as artificial freshness manipulation and may penalize the site by dropping the lastmod metadata from its priority queue. This can cause your crawl budget to be wasted, as search engines will ignore the lastmod headers entirely, leading to slower indexing of fresh articles and repetitive crawling of unchanged pages.

Some developers attempt to resolve this issue by querying Git directly for the last commit date of each file. However, this approach also has limitations. When using a shallow clone, Git only retains the latest commit history, and any files not modified in that commit are treated as having no commit history. Additionally, adding `fetch-depth: 0` to the GitHub Action to fetch the entire commit history can significantly increase build times and costs.

The article also discusses a subtle bug related to `git status --porcelain`, which can misinterpret dirty files (i.e., files with uncommitted changes) and mistakenly use their timestamps instead of the committed dates. This bug can further complicate the accurate representation of last modification dates in the sitemap.xml file.

In summary, relying on static timestamp values in your sitemap.xml can lead to SEO issues and wasted crawl budgets. It's essential to use more accurate methods for determining last modification dates, such as Git log or considering the limitations and potential pitfalls of each approach.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Detection content as code: reviewing a change the way you review software

Detection content as code: reviewing a change the way you review software The problem with editing rules in a console Detection rules written directly in a security platform have no review, no…

  • Detection rules should be treated as code with review, version control, and testing.
  • Store rules in plain text format within a repository for portability.

Day 16: Learning JavaScript DOM Manipulation — Create, Change & Delete Elements

My webdevelopment learning journey continues Today I learned about JavaScript DOM manipulation and how to create, modify, and delete HTML elements dynamically using JavaScript. 1.

  • document.getElementById() selects HTML elements by unique ID
  • document.createElement() creates new HTML elements dynamically
  • remove() method deletes elements from the webpage

Word-by-word captions with Python and ffmpeg, no CapCut watermark

Short-form video lives or dies on captions. CapCut and a dozen web tools will do the "word lights up as you say it" style for you, usually with a watermark or a free-minute limit.

  • Python script creates synchronized captions offline
  • Uses whisper with wordtimestamps for word boundaries
  • ffmpeg integrates captions without watermark

Cross-Chain Bridge Risk Assessment: Deribit

Cross-Chain Bridge Risk Assessment: Deribit Target Protocol : Deribit (TVL: $3898.1M) Cross‑Chain Bridge Risk Assessment – Deribit TVL: ≈ $3.9 B (Ethereum + L2) Date: 9 Oct 2026 Prepared by: Senior…

More from Friday 9 October →