Self host static assets

Now this may seem counter-intuitive, but stay with me.  Please self host your static assets. There was a big trend a few years ago (probably more than a few) to use CDNs, especially for third party libraries, such as jQuery.  And yes, I fell into this trap as well. The idea behind it was pretty…

My code is not unsafe(-eval)

I was working on a project this week when I came across something which confused me, and that was the following error in my browser console… Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed source of script in the following Content Security Policy directive: ‘self’ In itself, not massively odd.  I…

Easily fixing insecure references

One of the easiest mistakes to make when trying to convert an insecure HTTP website over to a secure HTTPS one is mixed content. Mixed content is when the site itself is loaded over HTTPS, but it contains links to content which are HTTP and therefore insecure – there’s no point knowing that the page…

New Cloudflare app – Instant Page

I wrote a post 3 months ago about pre-fetching links to improve performance.  This post talked about a library called instant.page, which is a free and open source library that uses just-in-time preloading, meaning it preloads a page right before a user clicks on it. Pages are preloaded only when there’s a good chance that a user…