cshelswell's avatar

HTML Build of Site - Trying to improve page load speeds

I'm not quite sure where to put this but what I'm thinking about doing or trying to do is do a HTML build of my site at the end of the day so pages load quick without any dynamic php. A good example would be a huge site bodybuilding.com http://www.bodybuilding.com/store/cobra-labs.html?searchTerm=cobra&_requestid=487911

I'm assuming just rendering HTML has a huge speed impact? We'd edit the pages as normal via php but do a HTML build at the end of the night.

I've found a couple of things but they seem to want to make you start a site like that. I have an ecommerce site I'd like to make html to speed things up... I assume it will?

I could be (probably am) talking nonsense but an online shop as big as bodybuilding.com surely can't be hand coding html pages?

Thanks for any help

0 likes
5 replies
martinbean's avatar

@cshelswell No, they won’t be converted pages to HTML. Although HTML is generated by PHP and served to the end user, so you can cache that response. Either using HTTP headers so the same user will get a cached version on subsequent visits, or at the server-level so your server caches the page, and then all users get served this cached version.

This does however introduce you to one of the two hardest things in programming: cache invalidation. If you need to publish a change, you need to work out how to invalidate your cached version. How you do that depends on what strategy you use to cache.

1 like
cshelswell's avatar

@martinbean - Thanks what you describe sounds like just what I'm thinking. So two questions:

1: In terms of page speed and getting good seo on google, is it worth the work to do it?

  1. If the above is an affirmative. You don't happen to have a good link to somewhere that gives advice on how to do it?

thanks for your answer, much appreciated.

martinbean's avatar
Level 80

@cshelswell It really depends on the level of traffic you’re getting. Are you really getting so much that your web site is grinding to a halt and that your hosting bills are spiralling out of control? As it may be you can make some quick wins caching an expensive database query or whatnot before introducing new things like Varnish into your tech stack that’s going to increase development time, knowledge required to work on the project, and introduce new problems (i.e. cache invalidation).

Other than, no, caching doesn’t have an SEO affect (as it’s the same HTML delivered whether it’s cached or dynamic). If there’s a massive difference in loading times between your cached version and dynamic version, then it may have a tiny affect on rankings, but you’re not going to shoot to the top of Google because you have a “fast” website, and especially if the different is only negligible (i.e. one or two milliseconds).

1 like
cshelswell's avatar

@martinbean The site works great and load times are pretty good, especially now I've loaded it on to a PHP7 server.

So I think your answer is pretty much bang on, it's not worth doing. Average load times according to pingdom are under 3 seconds.

Thanks very much for answering - now I don't have to wonder about whether I should cache html or not :)

Please or to participate in this conversation.