https://blog.superhosting.bg/en/w3-total-cache-settings-part-2.html

Press enter to see results or esc to cancel.

SuperHosting.BG Blog

General Settings in W3 Total Cache (Part 2)

2016-07-20
Support tips
W3 Total Cache, cache, wordpress, faster wordpress, memcached,SQL, minify

​In the first part we talked about several settings of the Page Cache module in the W3 Total Cache plugin, which you have to pay attention to. Now we will describe the remaining caching types in this plugin.

As Object Cache and Database Cache will work with default settings, you may only enable them. We will emphasize on Minify as this option has more detailed settings and is often the reason for incorrect site visualization.

Database Cache

The Database Cache module caches the results of the most frequent SQL queries to the database. Multiple SQL queries may be executed when a page of the website is being accessed. The number of queries may increase depending on the theme and the plugins on the website.

Recommended caching technology: Memcached

Settings in Database Cache you have to pay attention to

General

Enable theDon’t cache queries for logged in usersoption, if your website bandwidth comes mainly by anonymous users (users who are not logged in). If the bandwidth comes mostly by logged in users, then you may leave this option disabled.

Advanced

In “Memcached hostname:port / IP:port:” field insert the correct port for Memcache.

Object Cache

The Object Cache module uses a WP_Object_Cache WordPress’ class for caching objects which are used by the specific installation, such as last comments, last posts (sample objects options:alloptions, posts:category, themes, users, comment:last_changed, comment:get_comments, widget:widget_recent_posts, etc.).

Recommended caching technology: Memcached

Settings in Object Cache you have to pay attention to

Advanced

In the same manner as for Database Cache in the “Memcached hostname:port / IP:port:” field insert the correct port for Memcache.

Minify

Minify is a technique to reduce text file size, in this case: .css and .js. Size reduction is achieved by removing unnecessary characters and white space characters in the file, contents compression.

Along with minification the plugin also performs combination of multiple files into one. The contents of all .css files is combined into one .css file. .js files are also combined the same way.

Note: Not all .css and .js files are subject to combination and minification.

Recommended caching technology: Memcached

Settings in Minify you have to pay attention to

If you have enabled Disk as a caching method, you will be able to check the reduced .css and .js files, which will be generated in the /wp-content/cache/minify directory of the hosting account.

After you finish Minify settings completely, you will always be able to switch to caching technology: Memcached.

When you enable Minify through General Settings, you will be able to select the following Minify mode: Auto or Manual. In case after you have selected Auto, you notice incorrect loading of page style, switch to Manual mode.

Since there is a great variety of themes and plugins for WordPress, the Minify settings may differ for each theme and plugin. With the manual mode option of Minify you may test with various setup options, so as to avoid incorrect visualization of site style.

In settings page select Performance -> Minify enable Minify for HTML & XML, JS and CSS.

General

It is recommended that the Rewrite URL structure option for resource URL address rewriting is enabled.If the option is enabled URL address of the embedded .css and .js resources to the page will be without any variables. And instead of:/wp-content/plugins/w3-total-cache/pub/minify.php?file=60eac/default.include.2d9d50.cssit will be:/wp-content/cache/minify/000000/60eac/default.include.2d9d50.css

HTML & XML
From the options in HTML minify settings check Inline CSS minification andInline JS minification. These two options will minify CSS and JavaScript code, that is available directly in the source code (and not in a separate file).

JS

In the JS minify settings there are options for JavaScript code processing, that are applied to the respective areas of HTML document – Before /head (before the closing tag /head), After body (after opening body tag ) and Before /body (before the closing /body tag).

Minify – .js file minification and combination will also be applied;

Combine only – .js file combination will only be applied (without code minification);

Embed type: Several manners to embed .js code, blocking (Default) or non-blocking. The type of .js embedding is very important for correct visualization. At first test with Non-blocking using “async” and in case of incorrect loading, try with each of the remaining types.

In JS file management you may select .js files of the theme selected that will be minified and combined. For each .js file you may select the position in the HTML document, where it will be embedded – after the head tag, after body or before /body tag. Depending on the theme and if you are not sure where exactly you may embed the .js code without any problems, test various positions.

CSS

As with the .js files in this section in CSS file management add all .css files you would like to minfy. The .js and .css files may be arrangement by drag and drop.

Minify wizard: If you do not know which theme .css and .js files and plugins used are, take a look at the top of the page containing Minify settings and from the Get minify hints using the wizard sentence clickHelp. Minify wizard that will automatically display all .css and .js files of the theme and plugins will load. After you check all or only certain files, you may add them automatically by Apply & close.

Minify setting testing: After each change to settings, clear the cached information on Page Cache and Minify Cache modules. Then reload several pages to re-generate a new cache and to see the results of the changes.

Browser Cache

Browser Cache is used for keeping site information locally from user’s web browser. Web browser stores information such as images, scripts, pages, animations, etc. for faster website loading. This stored information is a copy of site original information and is stored locally on the computer hard disk.

Settings in Browser Cache you have to pay attention to

The recommended options which you may enable for all CSS, JS, HTML elements, images, etc. are Set Last-Modified header, Set expires header, Set entity tag (eTag) and Enable HTTP (gzip) compression.

To use gzip compression, at first you have to enable the mod_deflate module in cPanel from the “Optimize Website” menu. (Note: The mod_deflate module is offered with the SuperPro and SuperHosting plans.)

Cached information statistics by modules

Information on cached elements may be displayed by enabling the Debug Mode option in the General Settings. To see information on all modules, check Page cache, Minify, Database Cache and Object Cache. After you save the settings, reload a page and take a look at its source code. A list of all cached elements will appear in the code at the bottom as a HTML comment.

Tip from the Support:
It is recommended for the tests with this plugin settings not to be performed directly on the site, but on its draft copy.
You may enable the caching types one by one by testing whether the website runs properly after each change.
Trick from the Support:
To display cached elements, SQL queries, Object Cache data and ready HTML pages, you may select Disk caching for all modules. Then access the hosting account and look up in the following directory: /wp-content/cache/. For each cashing type there is a separate directory (db, minify, object, page), in which cached data is stored, saved in files. You may see cached data in each file. After viewing cached data, switch back to Memcached.
Important: When Disk caching is used for Page Cache, Object Cache and Database Cache, a large number of  inodes (files and directories) will be created in the cache directory. Depending on plugin settings this number may increase quickly and constantly. The selection of cache by means of Memcached is recommended for these three cashing types.

Technical Support Specialist

Megan is our support guru – she can answer every technical question. She knows everything about new technologies. Megan's SuperPower is that she can explain even the most complicated technologies in plain language.

500px270px
SuperHosting.BG

Related Posts

Leave a Reply

Be the First to Comment!

Notify of
avatar

wpDiscuz