This topic has 6 replies, 2 voices, and was last updated 10 years by rogeriovaz.
-
Author
-
October 2, 2015 at 07:05 #80368
rogeriovaz
ParticipantI 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!October 2, 2015 at 16:58 #80432Radu
ModeratorHi,
Remove query string from static resources by adding this snippet to kleo-child/functions.php
COPY CODEfunction 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 solutionOctober 2, 2015 at 17:41 #80442rogeriovaz
ParticipantHi Radu,
Well, it’s the same website that you are unable to see and everyone else are: http://www.elorural.com.br.
Refreshing memory, I’m using static file as index (index.html) and I remove manually all versions of css and js in html file, however I still get the message on gtmetrix.
I already had the code that you suggest in function file and my htaccess is configured as follow and you see the result of gtmetrix below.# Expires headers (for better cache control)
<IfModule mod_expires.c>
ExpiresActive on# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault “access plus 1 month”# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest “access plus 0 seconds”# Your document html
ExpiresByType text/html “access plus 0 seconds”# Data
ExpiresByType text/xml “access plus 0 seconds”
ExpiresByType application/xml “access plus 0 seconds”
ExpiresByType application/json “access plus 0 seconds”# Feed
ExpiresByType application/rss+xml “access plus 1 hour”
ExpiresByType application/atom+xml “access plus 1 hour”# Favicon (cannot be renamed)
ExpiresByType image/x-icon “access plus 1 week”# Media: images, video, audio
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “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”# HTC files (css3pie)
ExpiresByType text/x-component “access plus 1 month”# Webfonts
ExpiresByType application/x-font-ttf “access plus 1 month”
ExpiresByType font/opentype “access plus 1 month”
ExpiresByType application/x-font-woff “access plus 1 month”
ExpiresByType application/x-font-woff2 “access plus 1 month”
ExpiresByType image/svg+xml “access plus 1 month”
ExpiresByType application/vnd.ms-fontobject “access plus 1 month”# 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”
</IfModule>#############################################################################################################
There are 39 static components without a far-future expiration date.
http://www.google-analytics.com/analytics.js
http://www.elorural.com.br/wp-content/themes/kleo-child/buddypress/css/buddypress.css
http://www.elorural.com.br/wp-content/plugins/revslider/rs-plugin/css/settings.css
http://www.elorural.com.br/wp-content/themes/kleo/assets/css/bootstrap.min.css
http://www.elorural.com.br/wp-content/themes/kleo/assets/css/app.min.css
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/plugins/magnific-popup/magnific.css
http://www.elorural.com.br/wp-content/themes/kleo/assets/css/fontello.css
http://www.elorural.com.br/wp-includes/js/mediaelement/mediaelementplayer.min.css
http://fonts.googleapis.com/css?family=Roboto+Condensed%3A300%2C700&
http://www.elorural.com.br/wp-content/uploads/custom_styles/dynamic.css
http://www.elorural.com.br/wp-content/plugins/js_composer/assets/css/js_composer.css
http://www.elorural.com.br/wp-content/themes/kleo/assets/css/plugins.min.css
http://www.elorural.com.br/wp-content/themes/kleo-child/style.css
http://www.elorural.com.br/wp-includes/js/jquery/jquery.js
http://www.elorural.com.br/wp-includes/js/jquery/jquery-migrate.min.js
http://www.elorural.com.br/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js
http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/confirm.min.js
http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js
http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js
http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js
http://www.elorural.com.br/wp-content/plugins/buddypress/bp-core/deprecated/js/jquery-scroll-to.min.js
http://www.elorural.com.br/wp-content/themes/kleo-child/buddypress/js/buddypress.js
http://www.elorural.com.br/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.tools.min.js
http://www.elorural.com.br/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.revolution.min.js
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/init.js
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/modernizr.custom.46504.js
http://www.elorural.com.br/wp-includes/js/comment-reply.min.js
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/bootstrap.min.js
http://www.elorural.com.br/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/plugins/magnific-popup/magnific.min.js
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/plugins/carouFredSel/jquery.carouFredSel-6.2.0-packed.js
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/plugins/carouFredSel/helper-plugins/jquery.touchSwipe.min.js
http://www.elorural.com.br/wp-includes/js/mediaelement/mediaelement-and-player.min.js
http://www.elorural.com.br/wp-content/plugins/js_composer/assets/lib/isotope/dist/isotope.pkgd.min.js
http://www.elorural.com.br/wp-content/themes/kleo/assets/js/app.min.js
http://www.elorural.com.br/wp-content/plugins/js_composer/assets/js/js_composer_front.js
https://c6c25da9f03548367724b8af95c7bae87f35eec7.googledrive.com/host/0B5JmcUWWXmQBflJZSFJvMTVwOXpvM0x2MzQ5TXpwZy1zcHFJdUk0RVc4c0JnUlJMSFZuV1U/fundo_full.jpg
http://connect.facebook.net/en_US/sdk.js
http://www.elorural.com.br/wp-content/uploads/2015/06/Logo_.pngOctober 2, 2015 at 18:31 #80459Radu
ModeratorHi,
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 CODEhttps://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 solutionOctober 2, 2015 at 19:52 #80472Radu
ModeratorAdd 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 solutionOctober 2, 2015 at 20:55 #80476rogeriovaz
ParticipantAs 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” -
AuthorPosts
The topic ‘Expires headers’ is closed to new replies.