Página de Índice Estático

That title says “Static Index Page” in Spanish, in honor of it being the Day of the Dead, of Jill getting her blog back up, and of me starting to read her new book. She often posts Mexican music and language, and is Catholic, so it seems like all of these things are related. The circle of life.

I just made the index page a static document, not dynamic. For those of you not in the know of programming, WordPress generates pages from a coding language called PHP. It draws on a database and code in the PHP itself to generate the content you actually see in your browser. If you look at the code (Right click > “View source” in Chrome, for instance) on any WordPress page, like this one, you’re looking at generated HTML code (and CSS, and JavaScript). The dynamic PHP, if you could recognize it, is not visible on the compiled page.

Making database calls takes time, even if they are small, can add up to the loading time of a page. My index page, the page you see when you go to the https://jaydinitto.com, make a lot of little data calls to populate the list of posts, the link to them, etc. Even with all of those links, the load time is definitely not as long as WordPress installs that use a lot of plugins and extra code.

I decided to simply copy the generated code and stick it into a plain HTML file. If you name it index.html, WordPress automatically loads that, instead of the usual index.php. The end result is the same; however, I placed extra text way at the bottom to indicate the static file version. It would be easy to update manually, whenever I publish a new post, since I’d simply have to add the link to the new post at the top of the list.

Though it’s too small to notice in the end-user experience, the static version does make a significant difference. Here’s the normal, dynamic version:

And the static version:

You can see they both load the same things, but there’s a ~2000ms (2 second) quicker load time. When I delete some unnecessary code and consolidate of other code (there’s about 15 stylesheets!), it will be even faster. More to come!

5 Comments

  • Jill says:

    Circle of life indeed, ha ha. I just got a funny review, btw. For the like 5 books I’ve sold, I got a review. That’s good, right? Re the rest, I understand the Spanish, not necessarily the rest of what you’re talking about here. But that’s why I killed my blog!

    • Jay DiNitto says:

      I can leave a review if you’d like. Or at least, I’ll try. On Amazon a few years back I left a review for one of Mike Duran’s novels…I think Ghost Box. But amazon kept taking it down, maybe because it saw that I was an “insider” from mentioning that I beta read it. That’s what I get for being honest.

      I’ll leave that fact out when I submit my review. Heh, workin’ the system.

    • Jay DiNitto says:

      Forgot to mention: over the weekend, I read a ton of chapters of PenTriagon to my son, as he was playing the Switch. He was sort of paying attention. I think having me read to him is a comfort thing. In his defense, he was playing Super Paper Mario, which is fun, funny, and “wholesome,” so I didn’t mind the intermittent attention paid.

      • Jill says:

        You can do a review if you want. Some of my reviews get culled, but not yours, I don’t think. Not yet, anyway…. I think my book could be YA due to the teenage heroine. But I don’t think I would market it that way because I’m not sure the 2nd book would fit, although it has a teenage boy hero.

        • Jay DiNitto says:

          I’ll mirror the review on here, anyways. I’m through, in a moral sense, with actively providing content to anything centralized…especially a globalist behemoth like amazon. They have a great book selection, though.

1 Trackback or Pingback

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.