sainternet.xyz

Killing Half My Userbase, and Why I’d Do It Again

first posted on Thursday, 1 June 2023 01:10+12:00 (NZST)

It Was a Massacre

Making the decision to transition to ECDSA certification wasn't an easy one, but I would do it again in a heartbeat.

While overall client connections pretty much immediately halved, the number of unsolicited, malformed, malicious or otherwise junk queries dropped by a much larger amount.

Secure connections are faster, while maintaining comparable or better security to RSA certification.

Bullshit and general fuckery is low.

If I have any regret in this regard, it's not doing this sooner.

I’d Like to Think I’m Pretty Progressive

first posted on Thursday, 11 May 2023 21:10+12:00 (NZST)

How 2 PWA/Web APK

  1. Have a website.
  2. Have HTTPS.
  3. Have a manifest.
  4. Your site can now be saved to desktop.

  5. Have a service worker.
  6. Your site is now a progressive web application, it can be "installed".

  7. Have maskable icons in manifest.
  8. Have screenshots in manifest.
  9. Your site is now a PWA web APK, it can be installed as a native application.

  10. Collect underpants.
  11. ?
  12. Profit.

Gotta Go Fast!

first posted on Tuesday, 9 May 2023 07:00+12:00 (NZST)
updated on Tuesday, 9 May 2023 21:45+12:00 (NZST)

How sainternet.xyz Managed 100%1 on Major Website Performance Tests

GTmetrix, PageSpeed Insights, Website Speed Test etc.

I know the pain of waiting for a website to load.

There's no beating about the bush. It sucks. Not only is it frustrating, it can be a major factor in whether or not users stick around and browse a site.

That's why I'm always looking for ways to optimise website performance and deliver a faster, smoother experience with clean and striking visuals for everyone who visits my site.

Sometimes, You Actually Want to Finish Fast

The Home page reliably provides a sub-second SI (Speed Index) around ~06.s, with an FCP (First Contentful Paint) of ~0.4s and LCP (Largest Contentful Paint) of ~0.7s on a fresh load with no existing cache. Subsequent page loads (with cache) are even faster.

I've tried many different tactics to achieve faster load times, but I've found that a combination of strategies works best. For example, self-hosting everything possible, including Google fonts, is a great way to reduce the number of external requests and speed up page load times. I've also embraced modern image and font formats, which can significantly reduce file sizes and improve load times.

But it's not just about hosting and file formats. I've also implemented a JavaScript-powered FOUT (Flash Of Unstyled Text) font loading policy (the perception of fast loading is just as important, text should display as quickly as possible) and deferred JavaScript to ensure that my pages load quickly and efficiently.

Flash2, Ah-ah, Saviour of the Universe

The basic premise with FOUT, is to display the first available font that matches in your list, while promising to load the fonts you actually need, and then swapping fonts as soon as you know they are available. This allows the page to be rendered prior to fonts having loaded completely and provides a significant reduction in perceived load time.

It’s the Little Things That Count

Aggressive CSS, JavaScript and HTML minification has also been a key strategy, as has preloading assets and prerendering pages to speed up subsequent page loads. From anywhere you navigate to on sainternet.xyz, anywhere you could navigate to from there is already preloaded and prerendered, making for a PWA (Progressive Web Application) which feels more like a native application.

Size Does Matter

I have paid close attention to image sizing and scaling, in particular to avoid CLS (Cumulative Layout Shift), which can make for a frustrating user experience with page assets moving around the page as things load. You try and click on one thing, but then something else loads and it's moved. Yeah, nah. No one wants that.

By taking all of these steps and more, I've achieved a significantly faster, smoother and more navigable web experience.

Overall, optimising sainternet.xyz is an ongoing process, but by staying on top of the latest strategies and testing out new approaches, I'm confident that I can continue to deliver a better, faster web experience for all visitors.

Disclaimers

  1. On desktop browsers. Lighthouse3's emulated mobile hardware and connectivity is bulls… a rock, placed vaguely near an FM radio tower.
  2. It's not even in stereo.
  3. Not that one.
  4. Or that other one.
  5. Everything uses Lighthouse.
  6. Google decides how the Internet works.

Going Offline

first posted on Friday, 14 April 2023 22:30+12:00 (NZST)
updated on Saturday, 15 April 2023 21:30+12:00 (NZST)

Going Offline

sainternet.xyz is going offline.

Sorry. Rather, sainternet.xyz can go offline, and it isn't a problem. Let me explain.

Historically, handling offline in a website or progressive web application was hard, with each service deploying their own workarounds or even just choosing not to handle the case at all.

At Your Service

Enter the Service Worker API. Service workers give developers the tools they need to create effective offline experiences.

Using a service worker allows for the interception of requests within the service worker's scope, which can then be acted on accordingly. For instance sainternet.xyz's service worker uses both network first and cache first fetch policies depending upon the asset being requested. Objects that are likely to be static (fonts, images, etc.) or change infrequently are fetched by checking the cache first, falling back to network (if available) if the object is not found in the current cache. Dynamic or otherwise frequently updated objects are fetched from network first (if available), falling back to cache if the network request fails. Successful fetches from either case are added to the cache for later use.

Putting It All Together

After visiting any page on this site, if you're running an even vaguely modern browser and have JavaScript enabled, some magic should have happened.

Your browser was tested to see if it can support service worker registration, and if supported, a service worker was installed and registered. That service worker then created and populated a cache of critical objects (all those required for sainternet.xyz to function, approximately 4MB), and removed any orphaned caches. At this point you should be able to disconnect from the network or enter Flight Mode, and continue to navigate the site as usual.

homeBack to Home page.