You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary
Follow-up to PR #1063. Replaces the startup file-write with a dynamic
controller action, then addresses all issues identified in a dual AI
code review (GPT-5.5 + Claude Opus 4.6).
## Changes
### Server-side caching — was a no-op before
- Replace `[ResponseCache(Duration = 3600)]` with `[OutputCache(Duration
= 3600)]`
- Register `AddOutputCache()` and `UseOutputCache()` in `Program.cs`
- Previously `[ResponseCache]` only set `Cache-Control` headers — every
request still regenerated the sitemap XML. Now it's actually cached
in-process.
### Correct DI — remove `[FromServices]` workaround
- Expose `protected IRouteConfigurationService
RouteConfigurationService` in `BaseController`
- Remove `[FromServices] IRouteConfigurationService` action parameter
from `SitemapXml()` — this was resolving the same singleton twice and
was a code smell
### SEO fix — stop claiming every page changed on every request
- Remove `LastModificationDate = DateTime.UtcNow` from static controller
routes
- Setting `lastmod` to "right now" on every request teaches crawlers to
ignore the signal. Content page mappings still use
`siteMapping.LastModified` which is correct.
### Filter sitemap route from self-listing
- Add `sitemap` to the route exclusion list in `GenerateSitemapXml` so
`/sitemap.xml` doesn't appear in the sitemap
### Minor improvements
- Add `[EnableRateLimiting("content")]` to `SitemapXml` action
(consistent with other actions)
- Accept `IEnumerable<SiteMapping>` to avoid unnecessary `.ToList()`
allocation on every request
- Fix startup log messages: "generation" → "validation" (we no longer
generate a file at startup)
## Testing
- Both `EssentialCSharp.Web` and `EssentialCSharp.Web.Tests` build
cleanly with 0 errors
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
0 commit comments