Lightweight http page

 

 

-- Tue Aug 22 22:02:14 EDT 2023

 

Today I got the weight of the http page under 10kb. I think that's pretty good. Originally I thought that the page weight referred to the size of the source directory, which I then learned it wasn't. Page weight refers to how much data is recieved by the user after a request.

I didn't have to change much to get it under 10kb, since the http page just serves the gemini capsule converted to http. Gemini itself is very lightweight. I found that the biggest thing sent was actually the favicon, which was a whole 16kb! This was because I used an SVG for the favicon. Since the favicon is such a small image it's actually a lot smaller to just have a PNG, which now only takes about one and a half kb.

 

I also wanted to try to make the source of the page smaller too, which is now about 212kb. Although, this is harder because the filesystem uses blocks of 4kb, which means that even if a file is smaller than 4kb, it will still take up the whole block. This means the smallest non-empty file is 4kb. Since this site has a bunch of different posts, and many more posts will be added, each post will take up at least 4kb, even if the post is really small.

 

The only thing that I have to do now is figure out how to deal with non-monospace "monospace" fonts. On my desktop, the ascii art on the homepage looks fine. On my cell phone, however, the monospace font seems to not be completely monospace, and so the ascii art looks all messed up. I know that I can solve this issue by serving a font myself, but then the page weight will be a lot more than 10kb. Not really a problem, but I think that it's cool that the webpage is under 10kb, and I would rather not mess that up.

 

back to gemlog

 

EOF