One of the WordPress community's strengths is also its weakness; we found that numerous plugins are very handy and save some development time in a pinch, but the maintenance and performance penalties blogs suffer from as a result contribute to a poor user experience, which is never acceptable.
Experience has shown that fast loading web sites have (at least) the following characteristics:
In fact, if wordpress.com (for example) applied some of the techniques used in this plugin, we imagine they'd realize ~10% performance improvement on the CSS, JS and HTML (respectively) on the millions of blogs they host.
As a practical matter, Akamai and JupiterResearch did a study on acceptable wait time for retail web sites to load back in late 2006 concluding that users may leave after 4 seconds of waiting. That was several years ago now, even before 3G was available for mobile devices, what do you think web users expect today? According to Marissa Mayer of Google, as she stated the same year as Akamai, improving the speed of sites/applications reduces the learning curve for applications and contributes to higher use. It's time to bring the performance major corporations enjoy to the blogosphere.
As an aside, don't you think your site's KPI would be more meaningful if you could be confident that all users were having the exact same performance experience with your site? It's too early to say for sure, but we feel that the statistics and metrics we all use to track our progress and results will be more realistic when W3 Total Cache is actively removing bottlenecks from our blogs.
Please let us know what kind of mileage you have.
]]>In essence, anything that can be automated to squeeze out every bit of server performance and minimize bandwidth utilization has been done, leaving your readers with an optimized user experience.
]]>]]>"Minification is the practice of removing unnecessary characters from code to reduce its size thereby improving load times. When code is minified all comments are removed, as well as unneeded white space characters (space, newline, and tab). In the case of JavaScript, this improves response time performance because the size of the downloaded file is reduced. Two popular tools for minifying JavaScript code are JSMin and YUI Compressor. The YUI compressor can also minify CSS.
Obfuscation is an alternative optimization that can be applied to source code. It's more complex than minification and thus more likely to generate bugs as a result of the obfuscation step itself. In a survey of ten top U.S. web sites, minification achieved a 21% size reduction versus 25% for obfuscation. Although obfuscation has a higher size reduction, minifying JavaScript is less risky.
In addition to minifying external scripts and styles, inline <script> and <style> blocks can and should also be minified. Even if you gzip your scripts and styles, minifying them will still reduce the size by 5% or more. As the use and size of JavaScript and CSS increases so will the savings gained by minifying your code."
developer.yahoo.com
Fact of the matter, there was a time when the semantics and size of your HTML file (code-to-content ratio), was a factor in a more favorable ranking. POSH HTML has always been preferred by search engines. In some markets this may still be true, so give the search engines what they want.
]]>Please reach out to all of these people and support their projects if you're so inclined.
]]>In most cases providing an absolute path is sufficient and most reliable. You can of course use relative paths, but we discourage it unless you really know what you are doing.
]]>Examples (Never cache the following pages):
Note: To disable page caching of specific theme templates or plugin files you need to add define('DONOTCACHEPAGE', true); to it.
]]>Opcode caching does have a couple weaknesses:
It would appear that using APC database caching may be best, but your mileage may vary. So depending on what software you install and how you manage your server, you can choose the options to fit your needs. If you need help with the install on your dedicated or virtual dedicated linux-based server ask us!
]]><!--[if lte IE 8]><link rel="stylesheet" type="text/css" href="/wp-content/themes/default/lte.css" media="screen,projection" /><![endif]--> Or simply use the "Help" tool available on the minify settings page which will identify CSS and JS files used in the templates of your theme and properly assign them to the same. Simply tick the checkbox for files you wish to minify, click "Apply & close", then save your settings.
The plugin will combine, minify, HTTP compress and check for updates to these files automatically from now on. If you have any CSS or JS that are inline consider making them external files so that you can use them with minify.
]]>Unless you wish to use CloudFront, you're almost done, skip to the next paragraph if you're using CloudFront. Go to the "General Settings" tab and click the "Enable" checkbox and save the settings to enable CDN functionality. Empty the cache for the changes to take effect. If preview mode is active you will need to "deploy" your changes for them to take effect.
To use CloudFront, perform all of the steps above, except select the "Amazon CloudFront" "CDN type" in the "Content Delivery Network" section of the "General Settings" tab. When creating a new bucket, the distribution ID will automatically be populated. Otherwise, proceed to the AWS Management Console and create a new distribution: select the S3 Bucket you created earlier as the "Origin," enter a CNAME if you wish to add one or more to your DNS Zone. Make sure that "Distribution Status" is deployed and "State" is enabled. Now on "Content Delivery Network" tab of the plugin, copy the subdomain found in the AWS Management Console and enter the CNAME used for the distribution in the "CNAME" field.
You may optionally, specify up to 10 hostnames to use rather than the default hostname, doing so will improve the render performance of your site's pages. Additional hostnames should also be specified in the settings for the distribution you're using in the AWS Management Console.
Now go to the General tab and click the "Enable" checkbox and save the settings to enable CDN functionality and empty the cache for the changes to take effect. If preview mode is active you will need to "deploy" your changes for them to take effect.
]]>You also find a S3 configuration sample in the "ini" folder in the plugins directory.
]]>You may optionally, specify up to 10 hostnames to use rather than the default hostname, doing so will improve the render performance of your site's pages.
Now go to the General tab and click the "Enable" checkbox and save the settings to enable CDN functionality and empty the cache for the changes to take effect. If preview mode is active you will need to "deploy" your changes for them to take effect.
]]>Now go to the "General" tab and click the checkbox and save the settings to enable CDN functionality and empty the cache for the changes to take effect.
]]>The tool will scan your posts and pages for the cases above and copy them to your media library, update your posts to use the link addresses and produce a .htaccess file containing the list of of permanent redirects, so search engines can find the files in their new location.
You should backup your database before performing this operation.
]]>As always, it never hurts to back up your database first.
]]>facebookexternalhit FacebookExternalHit/1.1 FacebookExternalHit/1.0
Also make sure you have the correct xmlns:og /xmlns:fb tags in your opening HTML tag.
]]>A good rule of thumb is to try auto mode, work with a developer to identify the code that is not compatible and start with combine only mode (the safest optimization) and increase the optimization to the point just before functionality (JavaScript) or user interface / layout (CSS) breaks in your site.
We're always working to make this more simple and straight forward in future releases, but this is not an undertaking we can realize on our own. When you find a plugin, theme or file that is not compatible with minification reach out to the developer and ask them either to provide a minified version with their distribution or otherwise make sure their code is minification-friendly.
]]>Typically, you should ask your web host about the permissions issue and they should be able to resolve it. You can however try adding define('FS_METHOD', 'direct'); to wp-config.php to circumvent the file and folder checks.
]]>If you're larger organization or a web hosting company, consider looking into solutions that exist like Gear6 which could be useful now that you have a plugin that makes management memcached pain free.
]]>So we recommend an absolute minimum of 128MB for a typical blog; this figure is greater than some defaults, so keep that in mind. With statistics you'll be able to react accordingly and make adjustments.
For those that don't want or have time to learn anything new to get started, sample configuration files are included with the plugin containing inline comments for you.
]]>One day hopefully this plugin will contribute to making web servers greener and reduce the ecological footprint of the web by reducing the computational effort required to deliver high performance rich user experiences.
]]>define('W3TC_DYNAMIC_SECURITY', 'somesecurestring');
Edit your templates with the following syntax to ensure that dynamic features remain so. Replace W3TC_DYNAMIC_SECURITY with content of the constant or use echo to print constant:
Be aware that WordPress functions will not be available.
]]>Using functions:
$group_config = w3tc_get_user_agent_group($group_name); //name of the group $group_config['theme'] = 'newtheme'; $group_config['redirect'] = ''; $group_config['agents'] = array(escaped_string, [...]); $group_config['enabled'] = true; w3tc_save_user_agent_group($group_name, $group_config['theme'], $group_config['redirect'], $group_config['agents'], $group_config['enabled']);
Using filter:
function my_w3tc_mobile_groups($w3tc_groups) { // any operations // clear all groups example $w3tc_groups = array(); // delete all groups and add new example $w3tc_groups = array(....); // merge groups example: $w3tc_groups = array_merge($w3tc_groups, array( 'good_browsers' => array( 'theme' => 'good_theme/good_theme', 'enabled' => true, 'redirect' => '', 'agents' => array('firefox', 'chrome') ), 'bad_browsers' => array( 'theme' => 'bad_theme/bad_theme', 'enabled' => true, 'redirect' => '', 'agents' => array('msie', 'opera') ) )); return $w3tc_groups; } add_filter('w3tc_mobile_groups', 'my_w3tc_mobile_groups');]]>
Using functions:
$group_config = w3tc_get_referrer_group($group_name); //name of the group $group_config['theme'] = 'newtheme'; $group_config['redirect'] = ''; $group_config['referrers'] = array(escaped_string, [...]); $group_config['enabled'] = true; w3tc_save_referrer_group($group_name, $group_config['theme'], $group_config['referrer'], $group_config['referrers'], $group_config['enabled']);
Using filters:
function my_w3tc_referrer_groups($w3tc_groups) {]]>
// any operations // clear all groups example $w3tc_groups = array(); // delete all groups and add new example $w3tc_groups = array(....); // merge groups example: $w3tc_groups = array_merge($w3tc_groups, array( 'search_referrers' => array( 'theme' => 'search_theme', 'enabled' => true,
'redirect' => '',
'referrers' => array('google\.com') ), 'other_referrers' => array( 'theme' => 'video_theme', 'enabled' => true, 'redirect' => '', 'referrers' => array('youtube\.com') ) )); return $w3tc_groups; } add_filter('w3tc_referrer_groups', 'my_w3tc_referrer_groups');
To do it locally with WP-CLI:
Call wp w3-total-cache opcache_flush_file local file1
Call wp w3-total-cache opcache_flush local
// Adding a basic function. See GenesisAdmin.php for how to setup settings screen. add_filter('w3tc_extensions', 'custom_extension'); function custom_extension($extensions) { $extensions['some.theme'] = array ( 'name' => 'Custpom Framework Extension', 'author' => 'Bluw Widgets', 'description' => 'Adds specific caching capabilities.', 'author_uri' => 'http://example.com', 'extension_uri' => 'http://example.com', 'extension_id' => 'some.theme', 'settings_exists' => false, 'version' => '0.1', 'enabled' => true, 'requirements' => array(), 'path' => 'your-plugin-folder/extensions/CustomExtension.php' ); }]]>