• My site works (more or less) fine for almost a year, but if i open it after cleaning the cache of the browser, it takes a little bit more to load (the header and the top menu load quickly, however after that it stops for a while and then everything else loads). I was wondering what makes it stuck exactly at that point.

    Here are the possible causes (header):

    1. I have defined different css’ for single, page and index. It works fine, but I am not sure if its done in a “clean” way. Im afraid that maybe at this point the browser is somehow confused.

    The code:

    <?php if (is_single()){ ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/stylesingle.css" />
    <?php } else {?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/style.css" />
    <?php } ?>
    <?php if (is_page()){ ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/stylesingle.css" />
    <?php } ?>
    <?php if (is_search()){ ?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/searchpage.css" />
    <?php } ?>

    2. Then comes the loading of javascript which i need for the featured slider. Maybe this is the cause?

    Code:

    <?php $featured_slider_activate = get_theme_option('featured_activate'); if($featured_slider_activate == 'Yes') { ?>
    <link href="<?php bloginfo('template_directory'); ?>/css/gallery.css" rel="stylesheet" type="text/css" />
    <?php } else { ?><?php { /* nothing */ } ?><?php } ?>
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/dropmenu.jquery.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/dropmenu.js"></script>
    <?php $featured_slider_activate = get_theme_option('featured_activate'); if($featured_slider_activate == 'Yes') { ?>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/mootools.v1.11.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jd.gallery.v2.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jd.gallery.set.js"></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jd.gallery.transitions.js"></script>
    <?php } else { ?><?php { /* nothing */ } ?><?php } ?>

    3. Im not an expert but is this part maybe confusing? Cause it says remove action wp head and then wp head. I dont really understand it.

    <?php remove_action( 'wp_head', 'wp_generator' ); ?>
    <?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
    <?php wp_head(); ?>

    [Please use code buttons or backticks (not single quotes) for posting code]

    4. Then loads the widget with a Facebook Like Box code in it. I ussualy activate the Lazy Loader plugin on such widgets so the site won’t stuck because of them. However, if i do this on the FB like box, it won’t appear in IE.

    What can be the cause and the solution for this? Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I can be caused by many things of course. Maybe you can try using a site like : http://www.webpagetest.org to see if there is an obvious performance drop?

    You can also view your log files if there are many ‘mysql slow query’ logs around, it could for instance be conflicting plugins

    Thread Starter dasfgh

    (@dasfgh)

    Thank you very much for your help and for the links. I concentrated on gtmetrix, it’s a very useful tool.

    I tried to solve these issues with the W3 Total Cache plugin but it didn’t work well. Maybe its not compatible with my WP version. Many reported that the plugin is broken.

    I tried everything, 777 of .htaccess and the folders and so on, it didn’t help. Now I wonder if I returned them to their previous values properly. .htaccess was 644 and folders are 755 by default, correct?

    Now I’ll have to do everything without the plugin. Gmetrix offers some advices how to do it, but there are things that confuse me. For example:

    Gmetrix reports that Gzip compression is not enabled for my site and advices me to add a code in my .htaccess (see here), but there’s already such code in my .htaccess
    Here it is:

    # HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
    <IfModule filter_module>
    FilterDeclare   COMPRESS
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/x-icon
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
    FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
    FilterChain     COMPRESS
    FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
    </IfModule>
    
    <IfModule !mod_filter.c>
    # Legacy versions of Apache
    AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
    AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
    </IfModule>

    There is also a section about the browser cache in my .htaccess, which says:

    # Media: images, video, audio
    #   ExpiresByType image/gif                 "access plus 1 month"
    #   ExpiresByType image/png                 "access plus 1 month"
    #   ExpiresByType image/jpg                 "access plus 1 month"
    #   ExpiresByType image/jpeg                "access plus 1 month"
    #   ExpiresByType video/ogg                 "access plus 1 month"
    #   ExpiresByType audio/ogg                 "access plus 1 month"
    #   ExpiresByType video/mp4                 "access plus 1 month"
    #   ExpiresByType video/webm                "access plus 1 month"

    but Gmetrix reports that “The following cacheable resources have a short freshness lifetime.”

    Also it advices me to load java asynchronously. Would it be sufficient just to replace <script> with <script async> in the header ? And will older browsers properly understand this?

    Thank you for your help.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘What causes the slow loading?’ is closed to new replies.