---
title: Concatenate Assets Instead of Loading Conditionally
date: 2014-11-27T19:32:25+00:00
modified: 2014-11-27T19:45:16+00:00
permalink: https://kaspars.net/blog/concatenate-assets
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
post_tag:
  - CSS
  - Javascript
  - Speed
  - User Experience
category:
  - Web Performance
  - WordPress
---

# Concatenate Assets Instead of Loading Conditionally

One of the most popular suggestions for improving website performance that I often see in the WordPress world goes something like this:

> Enqueue only the CSS and Javascript necessary for the particular post or page. For example, load styles for a contact form or a shortcode only on the page where it is being displayed.

Don’t do that! The rendering [performance depends more on the number of requests than the transfer size of each request](https://developer.yahoo.com/performance/rules.html#num_http). It is much faster to load just one CSS file and one Javascript file with everything that your website will ever need since all the subsequent requests will be retrieved from the browser cache. Most of the WordPress caching plugins out there already provide this feature so just go ahead and use it.