Do template conditions slow down a site?

Hello!

I have a page template that I re-use for multiple purposes where I just hide sections using a condition that are not required.

My question to you is! …

Is that bad practice for site speed?

Or does the template get saved server-side for minimal speed impacts?

I also have a site cache, which I would suspect stores a version of the rendered template.

This isn’t my expertise as you can tell.

Thanks

Jack

Hello Jack,

Thanks for writing to us.

When you set the condition to hide the section, it will increase your website speed since the section and its content HTML markup will not render whereas if you hide the element using the Breakpoint it will hide the element through the CSS but the HTML markup will render.

Yes, when you save the template it will be saved on your server but it will not impact much, the website speed optimizations, There are several reasons affection your website loading speed for example

  1. Choose a better web hosting provider
  2. Reduce image sizes
  3. Minify JS and CSS files
  4. Use advanced caching mechanisms with a caching plugin
  5. Use a CDN
  6. Clean up WordPress database etc.

Please have a look at our doc about website performance improvement https://theme.co/docs/how-to-improve-site-performance
You can also check out this article to learn more about how to speed up your WordPress site.

You may check our video doc as well

Performance Tips: Image Optimization

Performance Tips: Critical Path CSS

Performance Tips: Minifying HTML, CSS & JS

Performance Tips: Reducing Plugin Load

In case you need website speed optimization you may subscribe to Boost where you’ll get speed optimizations.

Thanks

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.