# ---------------------------------------------------------------------- # Gzip compression # Compress content before it is delivered to the client # http://httpd.apache.org/docs/2.0/mod/mod_deflate.html # ---------------------------------------------------------------------- # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding # HTML, TXT, CSS, JavaScript, JSON, XML, HTC: FilterDeclare COMPRESS FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/html'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/css'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/plain'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/xml'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$text/x-component'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/javascript'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/json'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/xml'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/xhtml+xml'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/rss+xml'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/atom+xml'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/vnd.ms-fontobject'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$image/svg+xml'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$image/x-icon'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$application/x-font-ttf'" FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = '$font/opentype'" FilterChain COMPRESS FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no # Legacy versions of Apache AddOutputFilterByType DEFLATE text/html text/plain text/css application/json AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE text/xml application/xml text/x-component AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype jQuery(document).on( 'click', '.ewww-manual-optimize', function() { var post_id = jQuery(this).data('id'); var ewww_nonce = jQuery(this).data('nonce'); var ewww_manual_optimize_data = { action: 'ewww_flag_manual', ewww_manual_nonce: ewww_nonce, ewww_force: 1, ewww_attachment_ID: post_id, }; jQuery('#ewww-flag-status-' + post_id ).html( ewww_vars.optimizing ); jQuery.post(ajaxurl, ewww_manual_optimize_data, function(response) { var ewww_manual_response = JSON.parse(response); if (ewww_manual_response.error) { jQuery('#ewww-flag-status-' + post_id ).html( ewww_manual_response.error ); } else if (ewww_manual_response.success) { jQuery('#ewww-flag-status-' + post_id ).html( ewww_manual_response.success ); } }); return false; }); jQuery(document).on( 'click', '.ewww-manual-image-restore', function() { var post_id = jQuery(this).data('id'); var ewww_nonce = jQuery(this).data('nonce'); var ewww_manual_optimize_data = { action: 'ewww_flag_image_restore', ewww_manual_nonce: ewww_nonce, ewww_attachment_ID: post_id, }; jQuery('#ewww-flag-status-' + post_id ).html( ewww_vars.restoring ); jQuery.post(ajaxurl, ewww_manual_optimize_data, function(response) { var ewww_manual_response = JSON.parse(response); if (ewww_manual_response.error) { jQuery('#ewww-flag-status-' + post_id ).html( ewww_manual_response.error ); } else if (ewww_manual_response.success) { jQuery('#ewww-flag-status-' + post_id ).html( ewww_manual_response.success ); } }); return false; }); jQuery(document).on('click', '.ewww-show-debug-meta', function() { var post_id = jQuery(this).data('id'); jQuery('#ewww-debug-meta-' + post_id).toggle(); });