Got my site to load fast as all hell

Here's a question that I just figure out. My site is trying to load .css files for some of the javascript that I removed. I can't find in the header or functions files where these are being requested. How do I find and remove those requests? These two in particular are the one's that are giving me issues.

Code:
<link rel='stylesheet' id='nivo-slider-css'  href='/wp-content/themes/Gameleon/css/nivo-slider.css?ver=3.5.1' type='text/css' media='all' />
<link rel='stylesheet' id='news-ticker-css'  href='/wp-content/themes/Gameleon/css/news-ticker.css?ver=3.5.1' type='text/css' media='all' />

Have a look for:

@import url("css/news-ticker.css");

in style.css

and:

wp_register_style('news-ticker', get_template_directory_uri() . '/css/news-ticker.css' );

in custom_css.php
 
  • Like
Reactions: BlogHue


Here's a question that I just figure out. My site is trying to load .css files for some of the javascript that I removed. I can't find in the header or functions files where these are being requested. How do I find and remove those requests? These two in particular are the one's that are giving me issues.

Code:
<link rel='stylesheet' id='nivo-slider-css'  href='/wp-content/themes/Gameleon/css/nivo-slider.css?ver=3.5.1' type='text/css' media='all' />
<link rel='stylesheet' id='news-ticker-css'  href='/wp-content/themes/Gameleon/css/news-ticker.css?ver=3.5.1' type='text/css' media='all' />

Alright, someone from the forum PMed me with a copy of Gameleon earlier today. So here's a way to prevent their registration and enqueue.

Open includes/custom_css.php - should be something like this -

PHP:
<?php
add_action('wp_print_styles', 'register_custom_styles');
function register_custom_styles() {
    wp_register_style('superfish', get_template_directory_uri() . '/css/superfish.css' );
   wp_register_style('nivo-slider', get_template_directory_uri() . '/css/nivo-slider.css' );
   wp_register_style('news-ticker', get_template_directory_uri() . '/css/news-ticker.css' );
    wp_register_style('tiptip', get_template_directory_uri() . '/css/tipTip.css' );
    wp_enqueue_style('superfish');
    wp_enqueue_style('nivo-slider');
    wp_enqueue_style('news-ticker');
    wp_enqueue_style('tiptip');
}

Notice the styles are registered using the wp_register_style and are then further enqueued using the the wp_enqueue_style which adds them to your code.

What we do is we simply comment out those lines, like below -

PHP:
<?php
add_action('wp_print_styles', 'register_custom_styles');
function register_custom_styles() {
    wp_register_style('superfish', get_template_directory_uri() . '/css/superfish.css' );
    // wp_register_style('nivo-slider', get_template_directory_uri() . '/css/nivo-slider.css' );
    // wp_register_style('news-ticker', get_template_directory_uri() . '/css/news-ticker.css' );
    wp_register_style('tiptip', get_template_directory_uri() . '/css/tipTip.css' );
    wp_enqueue_style('superfish');
    // wp_enqueue_style('nivo-slider');
    // wp_enqueue_style('news-ticker');
    wp_enqueue_style('tiptip');
}

There we go, this should stop them from loading :)
 
Thanks BlogHue. I've been tearing the theme a part since yesterday trying to track that this down. Glad you got the theme to check it out. You're the best.
 
There is a lot that can still be done - For instance,

Image Optimization

The current Featured PNG that loads for the first post on your site is 128 KB - It can be further compressed to about 58 KB
3ahtT3W.png


This is applicable to all other images as well.

Unused Elements

- Flexslider CSS files are loading, even though there is no slider onpage.

- You're using the brankick social media widget, but from your footer, it is evident that you're using only four of the whole list of social icons that the widget supports. You can get rid of the extra set of icon calls from the css file, doing this will reduce the size of the css from the current 8.x KB to less than 2 KB.

- Again, I see a file loading for the WP External Link plugin, do you really need it? I don't see any use of it being made in any part of the site.

This is just what I could find from a quick glance at your source code, I am sure this can be further accentuated.

Yeah I know there's more I can do =)

Good call on removing FlexSlider, I didn't think of that!

I actually replaced the social icons with a sprite, so I can definitely remove that shit.

Please PM me details on your BlogHue plugin.
 
Anyone know the best way to address not specifying image dimensions on FlexSlider images that are intended to be responsive? Is it actually beneficial if they're being sized by JavaScript anyway? Obviously I don't want specifying the dimensions to break the responsiveness either.

Also, anyway to Specify a Vary: Accept-Encoding Header for files on MaxCDN?

Seems like any CSS cleanup tool I use just breaks responsive websites, anyone know of such a tool that doesn't break responsive sites?
 
One more thing, is it really worth getting multiple pull zones to reduce DNS lookups in terms of load time optimization. One of my sites requires about 5 different external scripts that I can't localize anyway, so I didn't think it would be worthwhile.

Also, I noticed that ifbyphone.com has an absurdly slow javascript snippet, which you can't localize. If you want to do call tracking, checkout RingRevenue instead. Their service is cheaper and their javascript snippet loads from the footer and the load time impact is minimal for an external javscript snippet at least.
 
is it really worth getting multiple pull zones to reduce DNS lookups in terms of load time optimization.

I would suggest that depends on the number of DNS reqs / file sizes. Part of the objective is to reduce that number anyway, but you may have many regardless of optimization due to the content.
Only tests will answer that question truthfully - again is it worth your time? Will it really improve conversions or ranking? (Non-rhetorical question.)
 
Here's an image loading question.

My site has about 25 thumbnails that load with the homepage They're not big files, but they take up some load time even though they're compressed to hell & back. They're being pulled from the post image through timthumb. Is there any way to reduce my homepage requests/page load time, but still keep my thumbs.

Right now this site is scoring 93 with 120 requests over 3.08 seconds. It's not bad considering what it has to load, but I know I could get that down even lower.
 
@efeezy can you combine images using CSS sprites?

That was my first idea, but since the thumbs on the homepage are being generated by timthump.php, I'd have no idea how to get them to load from a sprite. All of the other images, icons on the homepage are sprites, and that really helped cut down load time. Not sure about these thumbs though.
 
That was my first idea, but since the thumbs on the homepage are being generated by timthump.php, I'd have no idea how to get them to load from a sprite. All of the other images, icons on the homepage are sprites, and that really helped cut down load time. Not sure about these thumbs though.

Well I don't know of a script that would automate it for you, but you can use SpriteMe to automate the manual process for the thumbnails you already have available to speed things up a bit.
 
That was my first idea, but since the thumbs on the homepage are being generated by timthump.php, I'd have no idea how to get them to load from a sprite. All of the other images, icons on the homepage are sprites, and that really helped cut down load time. Not sure about these thumbs though.

So I assume that what thumbs are on the page depend on what has been published recently? In which case it seems like the sprite would have to be something the theme would have to create since it is dynamic based on content.

There isn't any reason the theme (or a plugin) couldn'd do that right? I mean I personaly have no idea, but it has to be programaticaly possible. Searching around it looks like people are asking for this but not finding answers...
 
So I assume that what thumbs are on the page depend on what has been published recently? In which case it seems like the sprite would have to be something the theme would have to create since it is dynamic based on content.

There isn't any reason the theme (or a plugin) couldn'd do that right? I mean I personaly have no idea, but it has to be programaticaly possible. Searching around it looks like people are asking for this but not finding answers...

Yeah that makes sense. For my site, the 25 thumbs that are on the front page are fairly static. They are from posts, but I keep the same ones on the home page for months at a time. However because the index.php file pulls the content photo via this:

Code:
<img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo str_replace('http://ww w.my website.com','',$image[0]); ?>&w=76&h=60"  alt="<?php the_title(); ?>" />

I would have no idea how to get it to use a sprite image.
 
Yeah that makes sense. For my site, the 25 thumbs that are on the front page are fairly static. They are from posts, but I keep the same ones on the home page for months at a time. However because the index.php file pulls the content photo via this:

Code:
<img src="<?php echo get_template_directory_uri(); ?>/scripts/timthumb.php?src=<?php echo str_replace('http://ww w.my website.com','',$image[0]); ?>&w=76&h=60"  alt="<?php the_title(); ?>" />

I would have no idea how to get it to use a sprite image.

Yeah, I think you are stuck. Seems like a CDN is a reasonable compromise.

I wonder if this isn't something that could be coded into a cacheing plugin though.
 
Yeah, I think you are stuck. Seems like a CDN is a reasonable compromise.

I wonder if this isn't something that could be coded into a cacheing plugin though.

It would be easy enough to get it to pull up the sprite file, but setting the background alignment values for each area is where I can't see there being a way to do it.