Skip to content

Bound sitemap preload traversal#131

Merged
mehul0810 merged 1 commit into
release/1.7.0from
fix/104-release-1.7.0-sitemap-preload-bounds
Jun 17, 2026
Merged

Bound sitemap preload traversal#131
mehul0810 merged 1 commit into
release/1.7.0from
fix/104-release-1.7.0-sitemap-preload-bounds

Conversation

@mehul0810

Copy link
Copy Markdown
Collaborator

Summary

Closes #104.

Bound page-cache sitemap preload traversal so one seed run stops after a limited number of child sitemap fetches and after the existing URL cap is filled, instead of fetching every child sitemap first and trimming later.

Base Branch Evidence

Scope

  • Add bounded child-sitemap traversal to PageCache::fetch_urls_from_sitemap().
  • Stop fetching child sitemaps once the per-run URL cap is satisfied.
  • Deduplicate sitemap URLs during collection instead of only after all child fetches complete.
  • Add unit-test bootstrap HTTP helpers plus regression coverage for traversal limits, early URL-cap exits, and fetch-failure queue preservation.

Intentionally Excluded

  • No cursor/checkpoint persistence across multiple sitemap seed runs.
  • No settings or UI changes for preload tuning.
  • No queue option schema changes or migration work.

Validation

  • php -l src/Modules/Cache/PageCache.php
  • php -l tests/bootstrap.php
  • php -l tests/unit-tests/tests-page-cache.php
  • ./vendor/bin/phpunit --filter Tests_Page_Cache
  • composer test
  • composer lint
  • ./vendor/bin/phpstan analyse --memory-limit=2048M --debug

Compatibility, Security, Privacy

  • Keeps the existing preload queue option contract intact.
  • Continues to accept only same-site HTTP(S) sitemap URLs.
  • Network failures still short-circuit safely without clearing the existing preload queue.
  • No new user data, secrets, telemetry, or public API surface introduced.

Rollback and Release Notes

  • Rollback is a straight revert of this PR's commit.
  • No version bump, migration, or release artifact change is required.
  • Release impact is limited to safer preload seeding behavior on larger sites.

Docs Status

  • No AGENTS.md update needed for this code-only runtime fix.
  • No in-repo docs or performwp.com docs change is required because this does not add a new setting, hook, or user-facing workflow.

Remaining Risk

  • I did not run a live cron/preload smoke test against a WordPress site from this worktree, so runtime proof is limited to unit/static validation.

@mehul0810 for release-line visibility.

@github-actions

Copy link
Copy Markdown

Test on Playground
Test this pull request on the Playground

@mehul0810 mehul0810 merged commit 0e6a57e into release/1.7.0 Jun 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant