Compare commits
3 Commits
afbba7e344
...
eac5573121
Author | SHA1 | Date |
---|---|---|
|
eac5573121 | |
|
ad5ecbd595 | |
|
a719edef94 |
|
@ -0,0 +1,39 @@
|
|||
+++
|
||||
date = '2024-11-15T22:33:10+01:00'
|
||||
draft = false
|
||||
title = 'More cache-busting'
|
||||
tags = ['linux','CSS']
|
||||
+++
|
||||
|
||||
**Well, that was easy.**
|
||||
|
||||
At the end of [my last post](cache-busting), I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution --- mine usually are --- but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted *only* when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.
|
||||
|
||||
Here is the new build script:
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
prev_mtime=$(cat styles.mtime)
|
||||
curr_mtime=$(stat -c %Y css/styles.css)
|
||||
|
||||
##has styles.css been modified?
|
||||
if [[ $prev_mtime != "$curr_mtime" ]]; then
|
||||
##update .mtimes
|
||||
sed -i "1s/.*/$curr_mtime/" styles.mtime
|
||||
echo "file has been modified!"
|
||||
##insert the commit id
|
||||
COMMIT="$(git rev-parse HEAD)"
|
||||
sed -i "s/css?=\w*/css?v=${COMMIT}/g" index.html
|
||||
fi
|
||||
```
|
||||
|
||||
## What?
|
||||
|
||||
The key here is the command `stat`, which gives access to a load of useful data from the Linux filesystem. In this case, we're getting the time last modified. Try it for yourself and see what comes back.
|
||||
```bash
|
||||
echo $(stat -c %Y foo.file)
|
||||
1731532468
|
||||
```
|
||||
|
||||
So all I have to do is write that unix timecode to a file (with our old friend `sed`), then I can compare this value to whatever gets returned at build time, and only insert the Git id if the CSS has changed. Job done!
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
+++
|
||||
date = '2024-11-13T14:24:21+01:00'
|
||||
date = '2024-11-14T14:24:21+01:00'
|
||||
draft = false
|
||||
title = 'Invalidating the browser cache'
|
||||
tags = ['css','html','linux']
|
||||
|
@ -34,7 +34,7 @@ Of course there is.
|
|||
Look at this:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="css/defaults.css?2"/>
|
||||
<link rel="stylesheet" href="css/defaults.css?v=2"/>
|
||||
```
|
||||
|
||||
As I'm requesting the file via http, I can append a query. Awesome. Not awesome enough though. I'm too lazy to edit this line of code every time I push a commit, and, being human, I'll probably forget at a critical moment. This can only mean one thing: it's time to bash (🤣) out a quick build script.
|
||||
|
@ -43,7 +43,7 @@ As I'm requesting the file via http, I can append a query. Awesome. Not awesome
|
|||
```bash
|
||||
#!/usr/bin/env bash
|
||||
COMMIT="$(git rev-parse HEAD)"
|
||||
sed -i "s/css?=\w*/css?${COMMIT}/g" index.html
|
||||
sed -i "s/css?v=\w*/css?${COMMIT}/g" index.html
|
||||
```
|
||||
|
||||
Let's talk about what's happening here:
|
||||
|
@ -56,7 +56,7 @@ Now, whenever we push a new commit, any CSS imports in `index.html` will be chan
|
|||
|
||||
```html
|
||||
<link rel="stylesheet"
|
||||
href="css/styles.css?=ab184410c10c1adfb8b85b03b316f72b"
|
||||
href="css/styles.css?v=ab184410c10c1adfb8b85b03b316f72b"
|
||||
/>
|
||||
```
|
||||
Now I just need to add the build script to my Jenkinsfile...
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
baseURL = 'http://192.168.70/'
|
||||
baseURL = 'http://devlog.ajstepien.xyz/'
|
||||
languageCode = 'en-us'
|
||||
title = 'Coding with Andrzej'
|
||||
theme = "cuqui"
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<title>
|
||||
Categories | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Categories on Coding with Andrzej</title>
|
||||
<link>http://192.168.70/categories/</link>
|
||||
<link>http://devlog.ajstepien.xyz/categories/</link>
|
||||
<description>Recent content in Categories on Coding with Andrzej</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<atom:link href="http://192.168.70/categories/index.xml" rel="self" type="application/rss+xml" />
|
||||
<atom:link href="http://devlog.ajstepien.xyz/categories/index.xml" rel="self" type="application/rss+xml" />
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<title>
|
||||
Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -30,7 +31,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
@ -54,11 +55,10 @@
|
|||
|
||||
<h1>Latest...</h1>
|
||||
|
||||
<h2><a href="/posts/cache-busting/">Invalidating the browser cache</a></h2>
|
||||
<p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
|
||||
<p>I pushed some changes incorporating images for the first time (I know – very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox… the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
|
||||
<p>The experienced computer touchers amongst you will be saying “this is obviously a cache problem”, and you’re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people’s machines? <strong>I needed to cache-bust.</strong></p>
|
||||
<a href="/posts/cache-busting/">Read more...</a>
|
||||
<h2><a href="/posts/cache-busting-2/">More cache-busting</a></h2>
|
||||
<p><strong>Well, that was easy.</strong></p>
|
||||
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution — mine usually are — but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p>
|
||||
<a href="/posts/cache-busting-2/">Read more...</a>
|
||||
|
||||
|
||||
</main>
|
||||
|
|
|
@ -2,24 +2,31 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Home on Coding with Andrzej</title>
|
||||
<link>http://192.168.70/</link>
|
||||
<link>http://devlog.ajstepien.xyz/</link>
|
||||
<description>Recent content in Home on Coding with Andrzej</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Wed, 13 Nov 2024 14:24:21 +0100</lastBuildDate>
|
||||
<atom:link href="http://192.168.70/index.xml" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>Fri, 15 Nov 2024 22:33:10 +0100</lastBuildDate>
|
||||
<atom:link href="http://devlog.ajstepien.xyz/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>More cache-busting</title>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting-2/</link>
|
||||
<pubDate>Fri, 15 Nov 2024 22:33:10 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting-2/</guid>
|
||||
<description><p><strong>Well, that was easy.</strong></p>
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution &mdash; mine usually are &mdash; but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Invalidating the browser cache</title>
|
||||
<link>http://192.168.70/posts/cache-busting/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/cache-busting/</guid>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting/</link>
|
||||
<pubDate>Thu, 14 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting/</guid>
|
||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Permissions strike again</title>
|
||||
<link>http://192.168.70/posts/permissions-strike-again/</link>
|
||||
<link>http://devlog.ajstepien.xyz/posts/permissions-strike-again/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/permissions-strike-again/</guid>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/permissions-strike-again/</guid>
|
||||
<description><p>Configuring Apache really isn&rsquo;t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it&rsquo;s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
<p>So, I&rsquo;m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I&rsquo;m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p></description>
|
||||
</item>
|
||||
</channel>
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-us" dir="ltr">
|
||||
<head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>
|
||||
| Coding with Andrzej
|
||||
</title>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/main.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/syntax.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/defaults.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/main.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://localhost:1313/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/">Home</a>
|
||||
</li>
|
||||
<li>
|
||||
<a aria-current="true" class="ancestor" href="/posts/">Posts</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/tags/">Tags</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
</header>
|
||||
<main>
|
||||
|
||||
|
||||
<h1></h1>
|
||||
|
||||
<time datetime="2024-11-15T22:33:10+01:00">November 15, 2024</time>
|
||||
|
||||
|
||||
|
||||
</main>
|
||||
<footer>
|
||||
<p>Copyright 2024. All rights reserved.</p>
|
||||
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en-us" dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>
|
||||
More cache-busting | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/main.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/syntax.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="/css/defaults.css" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script src="/js/main.23cd0c7d837263b9eaeb96ee2d9ccfa2969daa3fa00fa1c1fe8701a9b87251a1.js" integrity="sha256-I80MfYNyY7nq65buLZzPopadqj+gD6HB/ocBqbhyUaE=" crossorigin="anonymous"></script>
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/">Home</a>
|
||||
</li>
|
||||
<li>
|
||||
<a aria-current="true" class="ancestor" href="/posts/">Posts</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/tags/">Tags</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
</header>
|
||||
<main>
|
||||
|
||||
|
||||
<h1>More cache-busting</h1>
|
||||
|
||||
<time datetime="2024-11-15T22:33:10+01:00">November 15, 2024</time>
|
||||
|
||||
<p><strong>Well, that was easy.</strong></p>
|
||||
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution — mine usually are — but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p>
|
||||
<p>Here is the new build script:</p>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="cp">#!/usr/bin/env bash
|
||||
</span></span></span><span class="line"><span class="cl"><span class="cp"></span>
|
||||
</span></span><span class="line"><span class="cl"><span class="nv">prev_mtime</span><span class="o">=</span><span class="k">$(</span>cat styles.mtime<span class="k">)</span>
|
||||
</span></span><span class="line"><span class="cl"><span class="nv">curr_mtime</span><span class="o">=</span><span class="k">$(</span>stat -c %Y css/styles.css<span class="k">)</span>
|
||||
</span></span><span class="line"><span class="cl">
|
||||
</span></span><span class="line"><span class="cl"><span class="c1">##has styles.css been modified?</span>
|
||||
</span></span><span class="line"><span class="cl"><span class="k">if</span> <span class="o">[[</span> <span class="nv">$prev_mtime</span> !<span class="o">=</span> <span class="s2">"</span><span class="nv">$curr_mtime</span><span class="s2">"</span> <span class="o">]]</span><span class="p">;</span> <span class="k">then</span>
|
||||
</span></span><span class="line"><span class="cl"> <span class="c1">##update .mtimes</span>
|
||||
</span></span><span class="line"><span class="cl"> sed -i <span class="s2">"1s/.*/</span><span class="nv">$curr_mtime</span><span class="s2">/"</span> styles.mtime
|
||||
</span></span><span class="line"><span class="cl"> <span class="nb">echo</span> <span class="s2">"file has been modified!"</span>
|
||||
</span></span><span class="line"><span class="cl"> <span class="c1">##insert the commit id</span>
|
||||
</span></span><span class="line"><span class="cl"> <span class="nv">COMMIT</span><span class="o">=</span><span class="s2">"</span><span class="k">$(</span>git rev-parse HEAD<span class="k">)</span><span class="s2">"</span>
|
||||
</span></span><span class="line"><span class="cl"> sed -i <span class="s2">"s/css?=\w*/css?v=</span><span class="si">${</span><span class="nv">COMMIT</span><span class="si">}</span><span class="s2">/g"</span> index.html
|
||||
</span></span><span class="line"><span class="cl"><span class="k">fi</span>
|
||||
</span></span></code></pre></div><h2 id="what">What?</h2>
|
||||
<p>The key here is the command <code>stat</code>, which gives access to a load of useful data from the Linux filesystem. In this case, we’re getting the time last modified. Try it for yourself and see what comes back.</p>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">echo</span> <span class="k">$(</span>stat -c %Y foo.file<span class="k">)</span>
|
||||
</span></span><span class="line"><span class="cl"><span class="m">1731532468</span>
|
||||
</span></span></code></pre></div><p>So all I have to do is write that unix timecode to a file (with our old friend <code>sed</code>), then I can compare this value to whatever gets returned at build time, and only insert the Git id if the CSS has changed. Job done!</p>
|
||||
|
||||
<div>
|
||||
<div>Tags:</div>
|
||||
<ul class="post-tags">
|
||||
<li><a href="/tags/linux/">Linux</a></li>
|
||||
<li><a href="/tags/css/">CSS</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
<footer>
|
||||
<p>Copyright 2024. All rights reserved.</p>
|
||||
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
|
@ -6,6 +6,7 @@
|
|||
<title>
|
||||
Invalidating the browser cache | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
@ -52,7 +53,7 @@
|
|||
|
||||
<h1>Invalidating the browser cache</h1>
|
||||
|
||||
<time datetime="2024-11-13T14:24:21+01:00">November 13, 2024</time>
|
||||
<time datetime="2024-11-14T14:24:21+01:00">November 14, 2024</time>
|
||||
|
||||
<p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
|
||||
<p>I pushed some changes incorporating images for the first time (I know – very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox… the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
|
||||
|
@ -67,18 +68,18 @@
|
|||
<p>Of course there is.</p>
|
||||
<h3 id="using-a-query">Using a query</h3>
|
||||
<p>Look at this:</p>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"css/defaults.css?2"</span><span class="p">/></span>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span> <span class="na">href</span><span class="o">=</span><span class="s">"css/defaults.css?v=2"</span><span class="p">/></span>
|
||||
</span></span></code></pre></div><p>As I’m requesting the file via http, I can append a query. Awesome. Not awesome enough though. I’m too lazy to edit this line of code every time I push a commit, and, being human, I’ll probably forget at a critical moment. This can only mean one thing: it’s time to bash (🤣) out a quick build script.</p>
|
||||
<h3 id="automating-query-insertion">Automating query insertion</h3>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="cp">#!/usr/bin/env bash
|
||||
</span></span></span><span class="line"><span class="cl"><span class="cp"></span><span class="nv">COMMIT</span><span class="o">=</span><span class="s2">"</span><span class="k">$(</span>git rev-parse HEAD<span class="k">)</span><span class="s2">"</span>
|
||||
</span></span><span class="line"><span class="cl">sed -i <span class="s2">"s/css?=\w*/css?</span><span class="si">${</span><span class="nv">COMMIT</span><span class="si">}</span><span class="s2">/g"</span> index.html
|
||||
</span></span><span class="line"><span class="cl">sed -i <span class="s2">"s/css?v=\w*/css?</span><span class="si">${</span><span class="nv">COMMIT</span><span class="si">}</span><span class="s2">/g"</span> index.html
|
||||
</span></span></code></pre></div><p>Let’s talk about what’s happening here:</p>
|
||||
<p><code>COMMIT="$(git rev-parse HEAD)"</code> gets the commit id from Git and assigns it to the variable <code>$COMMIT</code>.</p>
|
||||
<p>Then, <code>sed -i "s/css?=\w*/css?${COMMIT}/g" index.html</code> does a find and replace in the file <code>index.html</code>. The regular expression <code>css?=\w*</code> matches ‘css?=’ plus any number of contiguous alphanumeric characters (everything until the next quote mark) before replacing these alphanumeric characters with the commit id. The flag <code>-i</code> tells <code>sed</code> to edit the file in place. The <code>g</code> tells it to perform the operation on the whole file.</p>
|
||||
<p>Now, whenever we push a new commit, any CSS imports in <code>index.html</code> will be changed to something like this:</p>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="p"><</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">"stylesheet"</span>
|
||||
</span></span><span class="line"><span class="cl"><span class="na">href</span><span class="o">=</span><span class="s">"css/styles.css?=ab184410c10c1adfb8b85b03b316f72b"</span>
|
||||
</span></span><span class="line"><span class="cl"><span class="na">href</span><span class="o">=</span><span class="s">"css/styles.css?v=ab184410c10c1adfb8b85b03b316f72b"</span>
|
||||
</span></span><span class="line"><span class="cl"><span class="p">/></span>
|
||||
</span></span></code></pre></div><p>Now I just need to add the build script to my Jenkinsfile…</p>
|
||||
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-groovy" data-lang="groovy"><span class="line"><span class="cl"> <span class="n">stage</span><span class="o">(</span><span class="s1">'build'</span><span class="o">){</span>
|
||||
|
@ -93,7 +94,7 @@
|
|||
<div>
|
||||
<div>Tags:</div>
|
||||
<ul class="post-tags">
|
||||
<li><a href="/tags/css/">Css</a></li>
|
||||
<li><a href="/tags/css/">CSS</a></li>
|
||||
<li><a href="/tags/html/">Html</a></li>
|
||||
<li><a href="/tags/linux/">Linux</a></li>
|
||||
</ul>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<title>
|
||||
Posts | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
@ -57,8 +58,25 @@
|
|||
<ul class="page-list">
|
||||
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/cache-busting-2/">More cache-busting</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-15T22:33:10+01:00">November 15, 2024</time>
|
||||
|
||||
<p><strong>Well, that was easy.</strong></p>
|
||||
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution — mine usually are — but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p>
|
||||
|
||||
<a href="/posts/cache-busting-2/">Read more...</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/cache-busting/">Invalidating the browser cache</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-14T14:24:21+01:00">November 14, 2024</time>
|
||||
|
||||
<p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
|
||||
<p>I pushed some changes incorporating images for the first time (I know – very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox… the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
|
||||
<p>The experienced computer touchers amongst you will be saying “this is obviously a cache problem”, and you’re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people’s machines? <strong>I needed to cache-bust.</strong></p>
|
||||
|
@ -69,6 +87,10 @@
|
|||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/permissions-strike-again/">Permissions strike again</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-13T11:53:13+01:00">November 13, 2024</time>
|
||||
|
||||
<p>Configuring Apache really isn’t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it’s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
|
||||
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
|
||||
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
||||
|
|
|
@ -2,24 +2,31 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Posts on Coding with Andrzej</title>
|
||||
<link>http://192.168.70/posts/</link>
|
||||
<link>http://devlog.ajstepien.xyz/posts/</link>
|
||||
<description>Recent content in Posts on Coding with Andrzej</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Wed, 13 Nov 2024 14:24:21 +0100</lastBuildDate>
|
||||
<atom:link href="http://192.168.70/posts/index.xml" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>Fri, 15 Nov 2024 22:33:10 +0100</lastBuildDate>
|
||||
<atom:link href="http://devlog.ajstepien.xyz/posts/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>More cache-busting</title>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting-2/</link>
|
||||
<pubDate>Fri, 15 Nov 2024 22:33:10 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting-2/</guid>
|
||||
<description><p><strong>Well, that was easy.</strong></p>
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution &mdash; mine usually are &mdash; but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Invalidating the browser cache</title>
|
||||
<link>http://192.168.70/posts/cache-busting/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/cache-busting/</guid>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting/</link>
|
||||
<pubDate>Thu, 14 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting/</guid>
|
||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Permissions strike again</title>
|
||||
<link>http://192.168.70/posts/permissions-strike-again/</link>
|
||||
<link>http://devlog.ajstepien.xyz/posts/permissions-strike-again/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/permissions-strike-again/</guid>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/permissions-strike-again/</guid>
|
||||
<description><p>Configuring Apache really isn&rsquo;t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it&rsquo;s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
<p>So, I&rsquo;m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I&rsquo;m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p></description>
|
||||
</item>
|
||||
</channel>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<title>
|
||||
Permissions strike again | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
|
|
@ -2,30 +2,33 @@
|
|||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
<url>
|
||||
<loc>http://192.168.70/tags/css/</loc>
|
||||
<lastmod>2024-11-13T14:24:21+01:00</lastmod>
|
||||
<loc>http://devlog.ajstepien.xyz/tags/css/</loc>
|
||||
<lastmod>2024-11-15T22:33:10+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/tags/html/</loc>
|
||||
<lastmod>2024-11-13T14:24:21+01:00</lastmod>
|
||||
<loc>http://devlog.ajstepien.xyz/tags/linux/</loc>
|
||||
<lastmod>2024-11-15T22:33:10+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/posts/cache-busting/</loc>
|
||||
<lastmod>2024-11-13T14:24:21+01:00</lastmod>
|
||||
<loc>http://devlog.ajstepien.xyz/posts/cache-busting-2/</loc>
|
||||
<lastmod>2024-11-15T22:33:10+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/tags/linux/</loc>
|
||||
<lastmod>2024-11-13T14:24:21+01:00</lastmod>
|
||||
<loc>http://devlog.ajstepien.xyz/tags/</loc>
|
||||
<lastmod>2024-11-15T22:33:10+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/tags/</loc>
|
||||
<lastmod>2024-11-13T14:24:21+01:00</lastmod>
|
||||
<loc>http://devlog.ajstepien.xyz/tags/html/</loc>
|
||||
<lastmod>2024-11-14T14:24:21+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/posts/permissions-strike-again/</loc>
|
||||
<loc>http://devlog.ajstepien.xyz/posts/cache-busting/</loc>
|
||||
<lastmod>2024-11-14T14:24:21+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://devlog.ajstepien.xyz/posts/permissions-strike-again/</loc>
|
||||
<lastmod>2024-11-13T11:53:13+01:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/posts/</loc>
|
||||
<loc>http://devlog.ajstepien.xyz/posts/</loc>
|
||||
<lastmod>2023-01-01T08:30:00-07:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/</loc>
|
||||
<loc>http://devlog.ajstepien.xyz/</loc>
|
||||
<lastmod>2023-01-01T08:00:00-07:00</lastmod>
|
||||
</url><url>
|
||||
<loc>http://192.168.70/categories/</loc>
|
||||
<loc>http://devlog.ajstepien.xyz/categories/</loc>
|
||||
</url>
|
||||
</urlset>
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>
|
||||
Css | Coding with Andrzej
|
||||
CSS | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
@ -49,7 +50,7 @@
|
|||
</header>
|
||||
<main>
|
||||
|
||||
<h1>Css</h1>
|
||||
<h1>CSS</h1>
|
||||
|
||||
|
||||
|
||||
|
@ -57,8 +58,25 @@
|
|||
<ul class="page-list">
|
||||
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/cache-busting-2/">More cache-busting</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-15T22:33:10+01:00">November 15, 2024</time>
|
||||
|
||||
<p><strong>Well, that was easy.</strong></p>
|
||||
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution — mine usually are — but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p>
|
||||
|
||||
<a href="/posts/cache-busting-2/">Read more...</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/cache-busting/">Invalidating the browser cache</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-14T14:24:21+01:00">November 14, 2024</time>
|
||||
|
||||
<p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
|
||||
<p>I pushed some changes incorporating images for the first time (I know – very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox… the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
|
||||
<p>The experienced computer touchers amongst you will be saying “this is obviously a cache problem”, and you’re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people’s machines? <strong>I needed to cache-bust.</strong></p>
|
||||
|
|
|
@ -1,18 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Css on Coding with Andrzej</title>
|
||||
<link>http://192.168.70/tags/css/</link>
|
||||
<description>Recent content in Css on Coding with Andrzej</description>
|
||||
<title>CSS on Coding with Andrzej</title>
|
||||
<link>http://devlog.ajstepien.xyz/tags/css/</link>
|
||||
<description>Recent content in CSS on Coding with Andrzej</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Wed, 13 Nov 2024 14:24:21 +0100</lastBuildDate>
|
||||
<atom:link href="http://192.168.70/tags/css/index.xml" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>Fri, 15 Nov 2024 22:33:10 +0100</lastBuildDate>
|
||||
<atom:link href="http://devlog.ajstepien.xyz/tags/css/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>More cache-busting</title>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting-2/</link>
|
||||
<pubDate>Fri, 15 Nov 2024 22:33:10 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting-2/</guid>
|
||||
<description><p><strong>Well, that was easy.</strong></p>
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution &mdash; mine usually are &mdash; but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Invalidating the browser cache</title>
|
||||
<link>http://192.168.70/posts/cache-busting/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/cache-busting/</guid>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting/</link>
|
||||
<pubDate>Thu, 14 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting/</guid>
|
||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||
</item>
|
||||
</channel>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<title>
|
||||
Html | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
@ -59,6 +60,10 @@
|
|||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/cache-busting/">Invalidating the browser cache</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-14T14:24:21+01:00">November 14, 2024</time>
|
||||
|
||||
<p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
|
||||
<p>I pushed some changes incorporating images for the first time (I know – very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox… the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
|
||||
<p>The experienced computer touchers amongst you will be saying “this is obviously a cache problem”, and you’re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people’s machines? <strong>I needed to cache-bust.</strong></p>
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Html on Coding with Andrzej</title>
|
||||
<link>http://192.168.70/tags/html/</link>
|
||||
<link>http://devlog.ajstepien.xyz/tags/html/</link>
|
||||
<description>Recent content in Html on Coding with Andrzej</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Wed, 13 Nov 2024 14:24:21 +0100</lastBuildDate>
|
||||
<atom:link href="http://192.168.70/tags/html/index.xml" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>Thu, 14 Nov 2024 14:24:21 +0100</lastBuildDate>
|
||||
<atom:link href="http://devlog.ajstepien.xyz/tags/html/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>Invalidating the browser cache</title>
|
||||
<link>http://192.168.70/posts/cache-busting/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/cache-busting/</guid>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting/</link>
|
||||
<pubDate>Thu, 14 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting/</guid>
|
||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||
</item>
|
||||
</channel>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<title>
|
||||
Tags | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
@ -59,7 +60,18 @@
|
|||
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/tags/css/">Css</a></h2>
|
||||
<h2 class="center"><a href="/tags/css/">CSS</a></h2>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/tags/linux/">Linux</a></h2>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -70,11 +82,6 @@
|
|||
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/tags/linux/">Linux</a></h2>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
|
|
|
@ -2,31 +2,31 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Tags on Coding with Andrzej</title>
|
||||
<link>http://192.168.70/tags/</link>
|
||||
<link>http://devlog.ajstepien.xyz/tags/</link>
|
||||
<description>Recent content in Tags on Coding with Andrzej</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Wed, 13 Nov 2024 14:24:21 +0100</lastBuildDate>
|
||||
<atom:link href="http://192.168.70/tags/index.xml" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>Fri, 15 Nov 2024 22:33:10 +0100</lastBuildDate>
|
||||
<atom:link href="http://devlog.ajstepien.xyz/tags/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>Css</title>
|
||||
<link>http://192.168.70/tags/css/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/tags/css/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Html</title>
|
||||
<link>http://192.168.70/tags/html/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/tags/html/</guid>
|
||||
<title>CSS</title>
|
||||
<link>http://devlog.ajstepien.xyz/tags/css/</link>
|
||||
<pubDate>Fri, 15 Nov 2024 22:33:10 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/tags/css/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Linux</title>
|
||||
<link>http://192.168.70/tags/linux/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/tags/linux/</guid>
|
||||
<link>http://devlog.ajstepien.xyz/tags/linux/</link>
|
||||
<pubDate>Fri, 15 Nov 2024 22:33:10 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/tags/linux/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Html</title>
|
||||
<link>http://devlog.ajstepien.xyz/tags/html/</link>
|
||||
<pubDate>Thu, 14 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/tags/html/</guid>
|
||||
<description></description>
|
||||
</item>
|
||||
</channel>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<title>
|
||||
Linux | Coding with Andrzej
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="http://devlog.ajstepien.xyz//index.xml" title="Coding with Andrzej">
|
||||
|
||||
|
||||
|
||||
|
@ -29,7 +30,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a href=http://192.168.70/><h1>Coding with Andrzej</h1></a>
|
||||
<a href=http://devlog.ajstepien.xyz/><h1>Coding with Andrzej</h1></a>
|
||||
|
||||
<nav>
|
||||
<ul>
|
||||
|
@ -57,8 +58,25 @@
|
|||
<ul class="page-list">
|
||||
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/cache-busting-2/">More cache-busting</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-15T22:33:10+01:00">November 15, 2024</time>
|
||||
|
||||
<p><strong>Well, that was easy.</strong></p>
|
||||
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution — mine usually are — but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p>
|
||||
|
||||
<a href="/posts/cache-busting-2/">Read more...</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/cache-busting/">Invalidating the browser cache</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-14T14:24:21+01:00">November 14, 2024</time>
|
||||
|
||||
<p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
|
||||
<p>I pushed some changes incorporating images for the first time (I know – very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox… the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
|
||||
<p>The experienced computer touchers amongst you will be saying “this is obviously a cache problem”, and you’re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people’s machines? <strong>I needed to cache-bust.</strong></p>
|
||||
|
@ -69,6 +87,10 @@
|
|||
|
||||
<li>
|
||||
<h2 class="center"><a href="/posts/permissions-strike-again/">Permissions strike again</a></h2>
|
||||
|
||||
|
||||
<time datetime="2024-11-13T11:53:13+01:00">November 13, 2024</time>
|
||||
|
||||
<p>Configuring Apache really isn’t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it’s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
|
||||
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
|
||||
<p>So, I’m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I’m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p>
|
||||
|
|
|
@ -2,24 +2,31 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>Linux on Coding with Andrzej</title>
|
||||
<link>http://192.168.70/tags/linux/</link>
|
||||
<link>http://devlog.ajstepien.xyz/tags/linux/</link>
|
||||
<description>Recent content in Linux on Coding with Andrzej</description>
|
||||
<generator>Hugo</generator>
|
||||
<language>en-us</language>
|
||||
<lastBuildDate>Wed, 13 Nov 2024 14:24:21 +0100</lastBuildDate>
|
||||
<atom:link href="http://192.168.70/tags/linux/index.xml" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>Fri, 15 Nov 2024 22:33:10 +0100</lastBuildDate>
|
||||
<atom:link href="http://devlog.ajstepien.xyz/tags/linux/index.xml" rel="self" type="application/rss+xml" />
|
||||
<item>
|
||||
<title>More cache-busting</title>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting-2/</link>
|
||||
<pubDate>Fri, 15 Nov 2024 22:33:10 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting-2/</guid>
|
||||
<description><p><strong>Well, that was easy.</strong></p>
<p>At the end of <a href="cache-busting">my last post</a>, I had successfully written a script to stop stale CSS from getting stuck in the browser cache. It was a rough-and-ready solution &mdash; mine usually are &mdash; but it did the job. The one optimization I wanted to make was to ensure that the cache gets busted <em>only</em> when there is fresh CSS, as opposed to on every build. I had expected to get a nice long blog post out of this, but it turns out to be a very easy job.</p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Invalidating the browser cache</title>
|
||||
<link>http://192.168.70/posts/cache-busting/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/cache-busting/</guid>
|
||||
<link>http://devlog.ajstepien.xyz/posts/cache-busting/</link>
|
||||
<pubDate>Thu, 14 Nov 2024 14:24:21 +0100</pubDate>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/cache-busting/</guid>
|
||||
<description><p><strong>I had a bit of an issue with my <a href="https://demos.ajstepien.xyz">website</a> recently.</strong></p>
<p>I pushed some changes incorporating images for the first time (I know &ndash; very swish, very modern), and everything seemed to be working just fine, but when I loaded the production site in Firefox&hellip; the images were not styled. Stranger still, they <em>were</em> styled when I loaded the same page in Chrome.</p>
<p>The experienced computer touchers amongst you will be saying &ldquo;this is obviously a cache problem&rdquo;, and you&rsquo;re right, it is obviously a cache problem. Pressing <code>CTR + SHIFT + R</code> (which forces Firefox to clear the cache and do a full reload) proved this thesis, and solved the immediate problem for me, on my machine. But what about other people&rsquo;s machines? <strong>I needed to cache-bust.</strong></p></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Permissions strike again</title>
|
||||
<link>http://192.168.70/posts/permissions-strike-again/</link>
|
||||
<link>http://devlog.ajstepien.xyz/posts/permissions-strike-again/</link>
|
||||
<pubDate>Wed, 13 Nov 2024 11:53:13 +0100</pubDate>
|
||||
<guid>http://192.168.70/posts/permissions-strike-again/</guid>
|
||||
<guid>http://devlog.ajstepien.xyz/posts/permissions-strike-again/</guid>
|
||||
<description><p>Configuring Apache really isn&rsquo;t rocket science. There are a wealth of great tutorials online, the documentation is very well documented, and the defaults work more or less out of the box. But it&rsquo;s one of those jobs that I do just infrequently enough that I always forget things in the interim, and end up making the same old mistakes.</p>
<p><em><strong>And it almost always has to do with permissions.</strong></em></p>
<p>So, I&rsquo;m writing this post both as a means of christening this devlog (<a href="https://demos.ajstepien.xyz">Hi! I&rsquo;m Andrzej! Hire me!</a>) and also as a reminder to myself that <em>the home folder is not executable by default.</em></p></description>
|
||||
</item>
|
||||
</channel>
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
{{ range .Pages }}
|
||||
<li>
|
||||
<h2 class="center"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
|
||||
{{if $isTags}}
|
||||
{{else}}
|
||||
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{
|
||||
$dateHuman := .Date | time.Format ":date_long" }}
|
||||
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
|
||||
{{end}}
|
||||
{{ .Summary }}
|
||||
{{if $isTags}}
|
||||
{{else}}
|
||||
|
|
|
@ -4,4 +4,5 @@
|
|||
{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title
|
||||
site.Title }}{{ end }}
|
||||
</title>
|
||||
<link rel="alternate" type="application/rss+xml" href="{{.Site.BaseURL}}/index.xml" title="Coding with Andrzej">
|
||||
{{ partialCached "head/css.html" . }} {{ partialCached "head/js.html" . }}
|
||||
|
|
Loading…
Reference in New Issue