DEV Community

Discussion on: How my website works

Collapse
 
easrng profile image
easrng

Hello. Your site looks really nice, but the header flickers during scrolling on my Android phone. I'll try to fix it, and I'll let you know what's causing it. Also, one way you could make you site faster is with a service worker. In case you don't know, that's a piece of JS run by the browser that sits between the website and the server, acting like a proxy. You can use it to do things like make your site available offline, and you can use WebAssembly to do it. Because TinyGo (a go compiler) supports compiling to WASM, you could make at least part of your server optionally run in the service worker, fetching only the markdown and metadata, and doing the page generation in the browser.

Collapse
 
michaelburrows profile image
Michael Burrows

Nice write up Chris.

Adding to what easrng said, it looks like you need to add a z-index to the nav as the images are scrolling over it.

Collapse
 
easrng profile image
easrng

That's not the issue I had, I realized the my browser seems to be a little qirky when it comes to elements fixed to the top. I think it's because I use bromite and the "show the omnibar all the time" patch is messing something up.

Collapse
 
gypsydave5 profile image
David Wickes

This is definitely the way ahead Chris. You should have a series of service workers prefetching your site as markdown and then rendering the HTML as you scroll down the page. Anything else isn't using enough JavaScript to be professional.

In fact, you should serve the entire site up as a wasm file including all the markdown and CSS inline. Use Webpack to chunk this appropriately. That way you can have your whole website loading whenever anyone visits your blog so that the page transistions will be lightning fast.

To optimize for SEO remember to serve the same content statically from your server whenever it gets crawled though. You're already doing this so that should be easy.

Collapse
 
easrng profile image
easrng • Edited

isn't using enough JavaScript to be professional

This is simply never true. There is no minimum amount of JS required. You usually can get by with just CSS.