Version static resource URLs, long-lived caching, rename icons folder - #22
Merged
Merged
Conversation
…ders assetURL()/uploadURL() append ?v=<filemtime> to wiki.js, the stylesheet, icons and uploads (also in rendered Markdown); .htaccess and the nginx rules send Cache-Control: max-age=31536000, immutable for them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Vk6fuPia3n4Fc1k34555U
Icon URLs already honor BASE_URI via assetURL(); the folder rename means stock Apache configs serve them, so the alias removal in tests/Server/run.sh is dropped. Adds a BASE_URI (subfolder) integration test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Vk6fuPia3n4Fc1k34555U
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Vk6fuPia3n4Fc1k34555U
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #21 and #13.
assetURL()/uploadURL()add?v=<filemtime>towiki.js, the stylesheet, icons and uploads; links and images to uploads in rendered Markdown are versioned too. All URLs honorBASE_URI..htaccess,pages/images/.htaccess) and nginx (INSTALL.md,tests/Server/nginx/w2.conf.template) sendCache-Control: max-age=31536000, immutablefor.js,.css,.svg,.pngand uploads.icons/is renamed tow2-icons/so stock Apache's/icons/alias no longer hides the icons; the alias workaround intests/Server/run.shis removed.index.cssreferencesinternet.pngrelative to the stylesheet.Note: custom CSS or files referencing
/icons/...need updating. Direct links to uploads without?v=can stay cached for up to a year after an overwrite.Tests
AssetUrlTest(unit),BaseUriTestand a versioned-URL integration test, server tests for cache headers.tests/Server/run.sh) were not run in this environment.🤖 Generated with Claude Code
https://claude.ai/code/session_014Vk6fuPia3n4Fc1k34555U
Generated by Claude Code