This topic has 6 replies, 2 voices, and was last updated 9 years by rogeriovaz.

  • Author
  • #80368
     rogeriovaz
    Participant

    I test my website in gtmetrix and he is showing that some files of kleo are not able to set expirate headres even when I configure the .htaccess file to do it.
    Would someone give me an ideia how to solve it?
    You can look the results here: https://gtmetrix.com/reports/www.elorural.com.br/I8X4EXDh
    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #80432
     Radu
    Moderator

    Hi,

    Remove query string from static resources by adding this snippet to kleo-child/functions.php

    COPY CODE
    
    function pu_remove_script_version( $src ){
    return remove_query_arg( 'ver', $src );
    }
    add_filter( 'script_loader_src', 'pu_remove_script_version' );
    add_filter( 'style_loader_src', 'pu_remove_script_version' );
    

    Then empty cache and check again.

    Read more here : https://archived.seventhqueen.com/forums/topic/how-do-i-sovle-this-query-issues-due-to-the-stings-with

    Regards

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #80442
     rogeriovaz
    Participant
    This reply has been set as private.
    #80459
     Radu
    Moderator

    Hi,

    I’ve tested on gtmetrix and i see that the cache for these resources is 30 minutes and the GtMetrix says :

    The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:

    COPY CODE
    
    https://c6c25da9f03548367724b8af95c7bae87f35eec7.googledrive.com/host/0B5JmcUWWXmQBflJZSFJvMTVwOXpvM0x2MzQ5TXpwZy1zcHFJdUk0RVc4c0JnUlJMSFZuV1U/fundo_full.jpg (20 seconds)
    http://connect.facebook.net/en_US/sdk.js (20 minutes)
    http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/deprecated/js/jquery-scroll-to.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/confirm.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/js_composer/assets/css/js_composer.css (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/js_composer/assets/js/js_composer_front.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/js_composer/assets/lib/isotope/dist/isotope.pkgd.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/revslider/rs-plugin/css/settings.css (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.revolution.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.tools.min.js (30 minutes)
    http://www.elorural.com.br/wp-content/themes/kleo-child/buddypress/css/buddypress.css (30 minutes)
    http://www.elorural.com.br/wp-content/themes/kleo-child/buddypress/js/buddypress.js (30 minutes)
    http://www.elorural.com.br/wp-content/themes/kleo-child/style.css (30 minutes)
    http://www.elorural.com.br/wp-content/themes/kleo/assets/css/app.min.css (30 minutes)
    http://www.elorural.com.br/wp-content/themes/kleo/assets/css/bootstrap.min.css (30 minutes)
    

    Try to set this

    COPY CODE
    
    # CSS and JavaScript
    ExpiresByType text/css “access plus 1 year”
    ExpiresByType application/javascript “access plus 1 year”
    ExpiresByType application/x-javascript “access plus 1 year”
    

    to

    COPY CODE
    
    
    # CSS and JavaScript
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 month"
    
    

    Let me know if will solve the issue.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #80465
     rogeriovaz
    Participant

    I altered, tested and nothing changed 🙁

    #80472
     Radu
    Moderator

    Add this at top of your htaccess

    COPY CODE
    
    <IfModule mod_expires.c>
    # Enable expirations
    ExpiresActive On 
    # Default directive
    ExpiresDefault "access plus 1 month"
    </IfModule>
    

    Let me know if it works

    Regards

    RAdu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #80476
     rogeriovaz
    Participant

    As you can read in my previous message sent on OCTOBER 2, 2015 AT 17:41 in this topic this configuration was already active.

    # Expires headers (for better cache control)
    <IfModule mod_expires.c>
    ExpiresActive on

    # Perhaps better to whitelist expires rules? Perhaps.
    ExpiresDefault “access plus 1 month”

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Expires headers’ is closed to new replies.

Log in with your credentials

Forgot your details?