1

My page is loading really slow due to my inexperience.

Can anyone help me speed things up by perhaps using Switchee and or Low Variables (and perhaps some Stash).

I'm really just looking to be schooled on this one.

Code to be optimised is below, all help and comments are greatly appreciated.

Thank you. =)

{logos} <!-- logos is a matrix field type and is returning 40 entries -->
    <div class="item">
        {if external_url}
            <a href="{external_url}" target="_blank"><img src="{logo}" alt="{title}" height="120" width="240" /></a>
        {if:elseif internal_url}
            <a href="{internal_url}"><img src="{logo}" alt="{title}" height="120" width="240" /></a>
        {if:else}
            <img src="{logo}" alt="{title}" height="120" width="240" />
        {/if}
    </div>
{/logos}

1 Answer 1

1

Frankly, ExpressionEngine code conditions to convert in switchee or law variables will not increase page speed.

To enhance the performance, you should try this plugin for if condition:(EE2) URL

To increase the page speed, There are several ways (You can use all of them)

  1. Use CE Cache Plugin: (EE2) URL
  2. Enable Gzip compression from .htaccess

    # BEGIN EXPIRES
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault "access plus 10 days"
        ExpiresByType text/css "access plus 1 week"
        ExpiresByType text/plain "access plus 1 month"
        ExpiresByType image/gif "access plus 1 month"
        ExpiresByType image/png "access plus 1 month"
        ExpiresByType image/jpeg "access plus 1 month"
        ExpiresByType application/x-javascript "access plus 1 month"
        ExpiresByType application/javascript "access plus 1 week"
        ExpiresByType application/x-icon "access plus 1 year"
    </IfModule>
    # END EXPIRES
    
    # BEGIN ZIP
    <ifModule mod_gzip.c>
        mod_gzip_on Yes
        mod_gzip_dechunk Yes
        mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
        mod_gzip_item_include handler ^cgi-script$
        mod_gzip_item_include mime ^text/.*
        mod_gzip_item_include mime ^application/x-javascript.*
        mod_gzip_item_exclude mime ^image/.*
        mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    # END ZIP
    
  3. Disable Page tracking by config: (Handling Extreme Traffic) URL

  4. Query Disabling (in channel entries) disable="custom_fields|categories|category_fields|member_data|pagination|trackbacks|relationships"

  5. You can also cache the channel entries by tag caching using parameter in exp:channel:entries cache="yes" refresh="30"

  6. You can use Template caching in Design > Template Manager > Template Preferences Manager. Under Enable Caching?

1
  • You're most welcome. If answer helps you, can you please mark it accepted so others can take benifits from it too.? Mar 22, 2017 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.