Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Could CSS/JS Be Slowing Site Down?

Featured Replies

Hi,

We host a number of websites for a specific industry sector, by providing a hosted ecommerce platform. All our client sites rest on the same server (a Google Cloud VM) with Google Cloud SQL behind. All our client sites experience page load times of around 2-3 seconds, except one. This client who is experiencing the slow load times feels it is our system causing this but as all our clients run through the same code, same database, same server it cannot be the case .. could it?

 

The problem website is;

http://www.companyformations247.co.uk

 

Some examples of other client sites on the same environment are;

https://www.rapidformations.co.uk

http://www.blueskyformations.co.uk

http://www.eacbs.com

 

I have used http://tools.pingdom.com/fpt/ to test page load times to check it wasn't the user machine. So am out of ideas and can only assume it is css/js related, could this be true? Does anyone have any ideas what could be causing this rogue performance issue?

 

Hoping :)

Thanks, Richard

I got about 2mb worth of assets:

 

- move all your JS to the bottom of the documents, right now on the home page at least you have these calls in the head which are blocking page load:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js" ></script>
<script type="text/javascript" src="/assets/script/jquery/jquery.qtip.js" ></script>
<script type="text/javascript" src="/assets/script/jquery/plugin.efiling.full.min.js" ></script>

- you're using the full JqueryUI version (230kb), consider using a custom version to remove unneeded components, this can reduce file size by up to 90%.

- consider combining JS into a few files as possible to reduce http requests

 

You are also calling 11 CSS files, again worth combining these as far as possible to reduce http requests

 

It's also worth looking at when you pull in JS and CSS, you should only be calling them into any page when you need them just downloading everything on every page type is just a waste and adds http requests needlessly.

 

Many of the images on the home page need optimising, davep's Gtmetrix report will give you some suggestions.

As the guys above mentioned the size of the assets, their location in the document and the fact they're not concatenated are really hurting your page load. I can imagine you're only using a really low % of the assets you are forcing your users to download.

 

This is one of the reasons writing from scratch often trumps throwing a bunch of plugins at a problem, unless they are specifically designed with that problem in mind. If you are using some plugins then consider concatenating them together. There are situations when using a plugin is a great idea, like GSAP for complex animimatons, jQuery for heavy DOM manipulation, but you have to be smart about what you use and where. If your site has heavy image content consider lazy loading the images.

 

JavaScript blocks the page render so put it in the footer, unless that particular piece of code is critical to the render itself.

have a look through some of those images too and check if some can't be saved as jpegs or then as png-8 with transparency using https://tinypng.com/ (the man with sign saves perfectly well using this at half the size.

have a look through some of those images too and check if some can't be saved as jpegs or then as png-8 with transparency using https://tinypng.com/ (the man with sign saves perfectly well using this at half the size.

 

This and look into lossless image compression. This can all be automated if you're running something like Grunt or Gulp :)

  • 2 weeks later...
  • Author

Thanks guys, sorry not replying sooner. For some reason I was expecting to get email notification of replies to posts and didn't :)

 

We inject the jQuery and js into the header as our e-commerce platform relies on them to render some of the company formation process within the site. We have pondered only injecting that into certain pages of our platform and not all but because it hasn't had an noticeable effect on anyone else's sites we ignored it for now.

It's worth noting we are not the web designer for any of those sites and are only the host, each of those sites has a different web designer who built the retrospective site for our client. The company formation agent (site owner) is our client - so we cannot make any changes to the site design and can only give recommendation back to our client.

 

As it happens, for reasons beyond comprehension, we have for the problem website put in an Apache Alias to bypass our asset renderer whilst Google techs investigate why the renderer barfs for that site assets and not the other sites.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.