wp-media / wp-rocket

Performance optimization plugin for WordPress
https://wp-rocket.me
GNU General Public License v2.0
700 stars 218 forks source link

Exclude "Revolution Slider" inline JavaScript to avoid the cache directory size issue #1335

Closed vmanthos closed 6 years ago

vmanthos commented 6 years ago

The Revolution Slider plugin adds inline JavaScript that causes the cache directory size to increase.

The part that is changing and causes the issue is:

jQuery(document).ready(function() {
            var ajaxRevslider = function(obj) {
                    var content = "";
                    data = {};
                    data.action = 'revslider_ajax_call_front';
                    data.client_action = 'get_slider_html';
                    data.token = '7bf9cf305b';
                    data.type = obj.type;
                    data.id = obj.id;
                    data.aspectratio = obj.aspectratio;
                    jQuery.ajax({
                                type: "post",
                                url: "https://cotswoldgiftware.com/wp-admin/admin-ajax.php",
                                dataType: 'json',
                                data: data,
                                async: !1,
                                success: function(ret, textStatus, XMLHttpRequest) {
                                        if (ret.success == !0)

Diff file: https://www.diffchecker.com/1JloI7Zt

Proposed Solution Exclude the following from the JavaScript combination process:

data.token

Related Ticket https://secure.helpscout.net/conversation/702254330/85140?folderId=2135277

hrcoliqueo commented 3 years ago

it worrkss!!!!

The Revolution Slider plugin adds inline JavaScript that causes the cache directory size to increase.

The part that is changing and causes the issue is:

  • data.token
jQuery(document).ready(function() {
            var ajaxRevslider = function(obj) {
                    var content = "";
                    data = {};
                    data.action = 'revslider_ajax_call_front';
                    data.client_action = 'get_slider_html';
                    data.token = '7bf9cf305b';
                    data.type = obj.type;
                    data.id = obj.id;
                    data.aspectratio = obj.aspectratio;
                    jQuery.ajax({
                                type: "post",
                                url: "https://cotswoldgiftware.com/wp-admin/admin-ajax.php",
                                dataType: 'json',
                                data: data,
                                async: !1,
                                success: function(ret, textStatus, XMLHttpRequest) {
                                        if (ret.success == !0)

Diff file: https://www.diffchecker.com/1JloI7Zt

Proposed Solution Exclude the following from the JavaScript combination process:

data.token

Related Ticket https://secure.helpscout.net/conversation/702254330/85140?folderId=2135277