diff --git a/src/cache-test-symlink.html b/src/cache-test-symlink.html new file mode 120000 index 0000000000000000000000000000000000000000..d8c61d513485154a60c43c84c5d6ab247a3d33a1 --- /dev/null +++ b/src/cache-test-symlink.html @@ -0,0 +1 @@ +cache-test.html \ No newline at end of file diff --git a/src/cache-test.html b/src/cache-test.html index 3b0a8d8d3a25baf719a2e18acfe7886f38a7bcc6..a60c97dab8501d0603718e5d594ca5a830e9ee99 100644 --- a/src/cache-test.html +++ b/src/cache-test.html @@ -8,6 +8,16 @@ <link rel="shortcut icon" href="gitlab-favicon.png"> <link rel="preload" href="style.css" as="style"> <link rel="stylesheet" href="style.css"> + <style> + img { + float: left; + margin-right: 1em; + } + + .clearfix { + clear: both; + } + </style> </head> <body> <header> @@ -18,27 +28,57 @@ </header> <main> <h1>Cache Test</h1> - + <img src="gitlab-logo.png" alt="GitLab logo" width=200> <p> This page is meant for testing caching. </p> <p> It was built on the <strong>%%BRANCH%%</strong> branch of the - <a href="%%PROJECT_URL%%"><strong>%%PROJECT_PATH%%</strong></a> project. + <a href="%%PROJECT_URL%%"><strong>%%PROJECT_PATH%%</strong></a> project in + <a href="%%JOB_URL%%">Job %%JOB_ID%%</a> at %%JOB_TIMESTAMP%%. </p> <p> - The current site revision is <a href="%%PROJECT_URL%%/-/commit/%%COMMIT_SHA%%"><code>%%COMMIT_SHA%%</code></a> from %%COMMIT_TIMESTAMP%%. + The current site revision is + <a href="%%PROJECT_URL%%/-/commit/%%COMMIT_SHA%%"><code>%%COMMIT_SHA%%</code></a> + from %%COMMIT_TIMESTAMP%%. </p> <p> - It was built in <a href="%%JOB_URL%%">Job %%JOB_ID%%</a> at %%JOB_TIMESTAMP%%. + Here's a static CSS file: <a href="style.css">style.css</a> </p> <p> - Here's a CSS file: <a href="style.css">style.css</a> + Here's a static image: <a href="gitlab-logo.png">gitlab-logo.png</a> </p> <p> - Here's an image: + Here's a symlink to this same page: <a href="cache-test-symlink.html">cache-test-symlink.html</a> </p> - <img src="gitlab-logo.png" alt="GitLab logo" width=200> + <h2 class="clearfix">Path Fudging</h2> + <p> + The server for GitLab Pages does some path fudging to make user experience + better, but you have to make sure you account for that fudging when you + purge the cache by URLs. The fudging rules are: + </p> + <ul> + <li>Directories can be accessed with or without a trailing slash.</li> + <li>Files can be accessed with or without a trailing slash.</li> + <li> + Files with the <code>.html</code> extension can be accessed with or + without the file extension. + </li> + </ul> + <p> + So every HTML file has four URLs it can be accessed on, and every other + file and directory has two. Here are some examples: + </p> + <ul> + <li><a href="cache-test.html">cache-test.html</a> + <li><a href="cache-test">cache-test</a> + <li><a href="cache-test.html/">cache-test.html/</a> + <li><a href="cache-test/">cache-test/</a> + <li><a href="style.css">style.css</a> + <li><a href="style.css/">style.css/</a> + <li><a href="sub">sub</a> + <li><a href="sub/">sub/</a> + </ul> </main> </body> </html>