Skip to content
Snippets Groups Projects
Verified Commit 7ead1a03 authored by Chris Coley's avatar Chris Coley
Browse files

Document all the valid URLs for files and directories in GitLab Pages

parent 29e4dda9
Branches
No related tags found
No related merge requests found
cache-test.html
\ No newline at end of file
...@@ -8,6 +8,16 @@ ...@@ -8,6 +8,16 @@
<link rel="shortcut icon" href="gitlab-favicon.png"> <link rel="shortcut icon" href="gitlab-favicon.png">
<link rel="preload" href="style.css" as="style"> <link rel="preload" href="style.css" as="style">
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
<style>
img {
float: left;
margin-right: 1em;
}
.clearfix {
clear: both;
}
</style>
</head> </head>
<body> <body>
<header> <header>
...@@ -18,27 +28,57 @@ ...@@ -18,27 +28,57 @@
</header> </header>
<main> <main>
<h1>Cache Test</h1> <h1>Cache Test</h1>
<img src="gitlab-logo.png" alt="GitLab logo" width=200>
<p> <p>
This page is meant for testing caching. This page is meant for testing caching.
</p> </p>
<p> <p>
It was built on the <strong>%%BRANCH%%</strong> branch of the 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>
<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>
<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>
<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>
<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> </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> </main>
</body> </body>
</html> </html>
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment