-
Author
Tagged: remove, Query Strings with ?, static resources
-
February 13, 2015 at 16:33 #46008sergeParticipant
Hi,
I received an F grade on GT matrix for do to a query strings with ?. See below for the results. How do I fix this issue get the site to perform well?
Remove query strings from static resources
Resources with a “?” in the URL are not cached by some proxy caching servers. Remove the query string and encode the parameters into the URL for the following resources:http://afroexcel.com/wp-content/plugins/bbpress/templates/default/js/editor.js?ver=2.5.4-5380
http://afroexcel.com/wp-content/plugins/buddypress-media/app/assets/css/font-awesome.min.css?ver=3.7.32
http://afroexcel.com/wp-content/plugins/buddypress-media/app/assets/css/main.css?ver=3.7.32
http://afroexcel.com/wp-content/plugins/buddypress-media/app/assets/js/rtMedia.backbone.js?ver=4.1
http://afroexcel.com/wp-content/plugins/buddypress-media/app/assets/js/rtMedia.js?ver=3.7.32
http://afroexcel.com/wp-content/plugins/buddypress-media/app/assets/sass/bower_components/foundation/js/foundation.min.js?ver=3.7.32
http://afroexcel.com/wp-content/plugins/buddypress-media/lib/touchswipe/jquery.touchSwipe.min.js?ver=3.7.32
http://afroexcel.com/wp-content/plugins/buddypress/bp-core/deprecated/js/jquery-scroll-to.min.js?ver=2.2
http://afroexcel.com/wp-content/plugins/buddypress/bp-core/js/confirm.min.js?ver=2.2
http://afroexcel.com/wp-content/plugins/buddypress/bp-core/js/jquery-cookie.min.js?ver=2.2
http://afroexcel.com/wp-content/plugins/buddypress/bp-core/js/jquery-query.min.js?ver=2.2
http://afroexcel.com/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js?ver=2.2
http://afroexcel.com/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js?ver=2.2
http://afroexcel.com/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=4.1
http://afroexcel.com/wp-content/plugins/contact-form-7/includes/js/jquery.form.min.js?ver=3.51.0-2014.06.20
http://afroexcel.com/wp-content/plugins/contact-form-7/includes/js/scripts.js?ver=4.1
http://afroexcel.com/wp-content/plugins/essential-grid/public/assets/css/settings.css?ver=2.0.2
http://afroexcel.com/wp-content/plugins/essential-grid/public/assets/js/jquery.themepunch.essential.min.js?ver=2.0.2
http://afroexcel.com/wp-content/plugins/js_composer/assets/css/js_composer.css?ver=4.4.2
http://afroexcel.com/wp-content/plugins/js_composer/assets/js/js_composer_front.js?ver=4.4.2
http://afroexcel.com/wp-content/plugins/js_composer/assets/lib/isotope/dist/isotope.pkgd.min.js?ver=4.4.2
http://afroexcel.com/wp-content/plugins/js_composer/assets/lib/waypoints/waypoints.min.js?ver=4.4.2
http://afroexcel.com/wp-content/plugins/moderation/js/moderation.js?ver=1.0.8.6
http://afroexcel.com/wp-content/plugins/paid-memberships-pro/css/frontend.css?ver=1.7.15.2
http://afroexcel.com/wp-content/plugins/paid-memberships-pro/css/print.css?ver=1.7.15.2
http://afroexcel.com/wp-content/plugins/paid-memberships-pro/js/paid-memberships-pro.js?ver=4.1
http://afroexcel.com/wp-content/plugins/revslider/rs-plugin/css/settings.css?ver=4.6.5
http://afroexcel.com/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.revolution.min.js?ver=4.6.5
http://afroexcel.com/wp-content/plugins/revslider/rs-plugin/js/jquery.themepunch.tools.min.js?ver=4.6.5
http://afroexcel.com/wp-content/plugins/wp-flexible-map/css/styles.css?ver=1.9.1
http://afroexcel.com/wp-content/plugins/wpmu-dev-facebook/css/wdfb.css?ver=4.1
http://afroexcel.com/wp-content/plugins/wpmu-dev-facebook/css/wdfb_connect_widget.css?ver=4.1
http://afroexcel.com/wp-content/plugins/wpmu-dev-facebook/css/wdfb_widget_events.css?ver=4.1
http://afroexcel.com/wp-content/plugins/wpmu-dev-facebook/js/wdfb_connect_widget.js?ver=4.1
http://afroexcel.com/wp-content/plugins/wpmu-dev-facebook/js/wdfb_facebook_login.js?ver=4.1
http://afroexcel.com/wp-content/plugins/zilla-shortcodes/js/zilla-shortcodes-lib.js?ver=4.1
http://afroexcel.com/wp-content/plugins/zilla-shortcodes/shortcodes.css?ver=4.1
http://afroexcel.com/wp-content/themes/kleo/assets/css/app.min.css?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/css/bootstrap.min.css?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/css/fontello.css?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/css/plugins.min.css?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/app.min.js?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/bootstrap.min.js?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/init.js?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/modernizr.custom.46504.js?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/plugins/carouFredSel/helper-plugins/jquery.touchSwipe.min.js?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/plugins/carouFredSel/jquery.carouFredSel-6.2.0-packed.js?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/plugins/magnific-popup/magnific.css?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/assets/js/plugins/magnific-popup/magnific.min.js?ver=2.4
http://afroexcel.com/wp-content/themes/kleo/bbpress/css/bbpress.css?ver=4.1
http://afroexcel.com/wp-content/themes/kleo/buddypress/css/buddypress.css?ver=2.2
http://afroexcel.com/wp-content/themes/kleo/buddypress/js/buddypress.js?ver=2.2
http://afroexcel.com/wp-content/uploads/custom_styles/dynamic.css?ver=2.4
http://afroexcel.com/wp-includes/css/dashicons.min.css?ver=4.1
http://afroexcel.com/wp-includes/js/backbone.min.js?ver=1.1.2
http://afroexcel.com/wp-includes/js/comment-reply.min.js?ver=4.1
http://afroexcel.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1
http://afroexcel.com/wp-includes/js/jquery/jquery.js?ver=1.11.1
http://afroexcel.com/wp-includes/js/jquery/jquery.masonry.min.js?ver=3.1.2
http://afroexcel.com/wp-includes/js/jquery/ui/accordion.min.js?ver=1.11.2
http://afroexcel.com/wp-includes/js/jquery/ui/core.min.js?ver=1.11.2
http://afroexcel.com/wp-includes/js/jquery/ui/effect-fade.min.js?ver=1.11.2
http://afroexcel.com/wp-includes/js/jquery/ui/effect.min.js?ver=1.11.2
http://afroexcel.com/wp-includes/js/jquery/ui/tabs.min.js?ver=1.11.2
http://afroexcel.com/wp-includes/js/jquery/ui/widget.min.js?ver=1.11.2
http://afroexcel.com/wp-includes/js/masonry.min.js?ver=3.1.2
http://afroexcel.com/wp-includes/js/mediaelement/mediaelement-and-player.min.js?ver=2.15.1
http://afroexcel.com/wp-includes/js/mediaelement/mediaelementplayer.min.css?ver=2.15.1
http://afroexcel.com/wp-includes/js/mediaelement/wp-mediaelement.css?ver=4.1
http://afroexcel.com/wp-includes/js/mediaelement/wp-mediaelement.js?ver=4.1
http://afroexcel.com/wp-includes/js/plupload/plupload.full.min.js?ver=2.1.1
http://afroexcel.com/wp-includes/js/thickbox/thickbox.css?ver=4.1
http://afroexcel.com/wp-includes/js/thickbox/thickbox.js?ver=3.1-20121105
http://afroexcel.com/wp-includes/js/underscore.min.js?ver=1.6.0February 13, 2015 at 18:52 #46027RaduModeratorHello,
Add this code to you kleo-child functions.php
COPY CODEfunction _remove_script_version( $src ){ $getMyUrl = site_url(); $check = strpos($src, $getMyUrl); if ($check !== false) { $parts = explode( '?', $src ); return $parts[0]; }else{ return $src; } } add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMay 19, 2015 at 11:42 #593835high-photohubParticipant@serge – did it work? if so can you confirm what worked (ie. was it the exact code above in your child theme functions.php or slightly different? as I’ve found a few variations of this via Google).
Also did it in fact speed up your page load at all?
Any info would be appreciated as I’m looking to do this too.
many thanks.
May 20, 2015 at 05:48 #595195high-photohubParticipantFYI I’ve just retested my page load after adding this code (i used the version given by the Remove Query Strings plugin author here: http://www.paulund.co.uk/remove-query-string-stylesheets#):
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' );
and it now loads 5 – 6 secs faster for first load and 2 secs faster for repeat loads! Admittedly my site was super slow (hence trying everything to fix it) but this still seems impressive!
And so far I’ve not seen any problems/errors…
Thanks for putting this up here too Radu, otherwise i might not have found it!
June 16, 2015 at 00:59 #63035zafariParticipantThank you for posting this!!!!! I used the same code and have seen a dramatic improvement in my page load times. I would have never found this otherwise…. 🙂
July 15, 2015 at 02:34 #68322formasiruaParticipantfunction 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’ );coding above installed where? where the file? directory what?
thanksJuly 15, 2015 at 03:49 #683285high-photohubParticipantHi @formasirua – the code above was added into my child theme functions.php file.
Cheers.February 5, 2016 at 00:23 #102234KosiiiParticipantSorry for opening this thread again, but it is relevant to my question.
Ive been using this script for some time now and it improves the loading of the site, BUT it hides the “Post” button in the groups and profile when I want to post an update.
Is there a way to do this, but not have this consequence ?
February 5, 2016 at 17:05 #102318RaduModeratorHi Kosiii,
Please paste here exactly what snipped do you use
Cheers
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘KLEO’ is closed to new topics and replies.