Плагин w3 total cache имеет очень большой функционал, и способен вывести Ваш сайт на новый уровень по скорости. Давай рассмотрим его возможности.

W3 Total cache

Плагин понравился мне тем, что в отличии от других, не вызвал никаких проблем с сайтом, отработав корректно (хотя резервную копию все равно рекомендую создать) Например плагин Hyper-cache испортил мне css стили, после деактивации и удаления плагина проблема не решилась. Разбираться в чем конкретно было дело я не стал.

Также w3 total cache обладает довольно понятными настройками. Давайте разберем их. После установки у нас появляется боковое меню perfomance

Самая важная для нас вкладка General, она отвечает за включение или отключение дополнительных возможностей. По порядку

Toggle all caching types on or off (at once) – включить все опции, это нам вряд ли пригодится, галочку не ставим.

Page cache , очень нужная и важная вкладка, позволяет сократить время ответа от сервера за счет кэширования страниц на сервере. То есть плагин генерирует странички html, кладет из в папку кэша и отдает по запросу, экономя время на генерацию страницы apache. Page cache metod выставляется в зависимости от хостинга, в данном примере установлен для виртуального хостинга, если у Вас , выберите соответствующие параметры.

создать новый проект

включить в нём “PageSpeed Insights API ”

и создать новый public api access key (browser).

Получим на dashboard такую картинку

Verify rewrite rules – уведомление об ошибках, включить.

File locking и optimize disk оставляем выключенными.

Enable edge mode – включает режим разработчика, новые возможности. Может работать нестабильно.

Debug. Режим отладки. Добавляет техническую информацию в код каждой страницы. Не рекомендуется оставлять включенным, использовать по мере надобности.

Import Export Позволяет сохранять и загружать конфигурацию плагина.

Расширенные настройки

Следующие пункты меню отвечают за тонкие настройки включенных выше возможностей.

Page cache General

Cache front page – кэширование главной страницы

Cache feeds – кэширование категорий, тэгов, комментариев

Cache ssl – если Ваш сайт использует SSL шифрование

Cache URI s with query string variables – кэширование запросов поиска

Cache 404 (not found) pages – Кэширование страницы 404

Cache requests only for site.ru site address – кэш только для такого адреса сайта (без www)

Don’t cache pages for logged in users – не кэшировать страницы авторизованных пользователей (что бы не авторизованные не увидели кэш Вашей страницы)

Don’t cache pages for following user roles – Не кэшировать страницы для следующих ролей

Cache preload – кэш создается заранее, до того как пользователь запросит страницу.

Update interval – периодичность с которой создается кэш

Pages per interval – количество страниц, которое создается в созданный интервал.

Sitemap URL – укажите путь к Вашей карте сайта, и тогда кэш страницы будет создаваться согласно карте сайта, и приоритетам в ней.

Preload the post cache upon publish events – создание кэша при публикации поста.

Purge policy: page cache – разделы кэша, которые будут обновлены при публикации поста.

Advanced – по большому счету служебные настройки, трогать их не обязательно.

Minify General

Rewrite url structure – сокращает путь до js и css файлов

Disable minify for logged in users – выключить сжатие для авторизованных пользователей.

HTML & XML

Enable – включить

inline css minification – оптимизирует CSS

Inline JS minification – оптимизирует JS

Don’t minify feeds – не сжимает стили лент

Line break removal – удаление разрывов

Operations in areas – до тега head, только минифицировать или только объединить.

Embed type – Тип встраивания скриптов. По умолчанию – default, blocking. Лучше попробовать выбрать non-blocking using “async”.

Preserved comment removal – сохранение комментариев (в скрипте)

Line break removal – удаление разрывов (не безопасно)

Combine only – только объединить.

Preserved comment removal (not applied when combine only is active) – сохранить комментариев. Не сохраниться, если активно “только объединить”

Line break removal (not safe, not applied when combine only is active) – удаление разрывов. Не сохраниться, если активно “только объединить”

Advanced

Служебные настройки, можно ничего не менять.

Database cache General

Object cache

Maximum lifetime of cache objects: – время жизни кэша

Garbage collection interval – период удаления устаревшего кэша.

Browser cache

Вкладка General включает выбранный параметр всем группам ниже: CSS&JS HTML&XML MEDIA&OTHER FILES

Set Last-Modified header – Установит в заголовке дату последнего измнения документа.

Set expires header – время жизни кэша.

Set cache control header – новая директива жизни кэша, имеет приоритет над expires.

Set entity tag (eTag) – entity tag, метка, присваивается ресурсу, при изменении ресурса изменяется. Позволяет понять браузеру изменился контент или нет.

Set W3 Total Cache header – устанавливает в заголовке идентификатор w3 total cache.

Enable HTTP (gzip) compression – включает сжатие файлов методом deflate, не будет работать в связке с nginx.

Prevent caching of objects after settings change – запретить кэширование для указанных объектов.

Prevent caching exception list -список исключений кэширования.

Don’t set cookies for static files – не устанавливать куки для статических файлов

Do not process 404 errors for static objects with WordPress – не генерировать ошибку 404 для ненайденных статических объектов.

404 error exception list – список исключений

Extensions

CloudFlare – Обратный прокси-сервер (англ. reverse proxy ) - тип прокси-сервера, который ретранслирует запросы клиентов из внешней сети на один или несколько серверов, логически расположенных во внутренней сети. При этом для клиента это выглядит так, будто запрашиваемые ресурсы находятся непосредственно на прокси-сервере.(платный)

FeedBurner - веб-сервис, который пропускает через себя RSS-потоки, исправляет в них мелкие ошибки и может добавить потоку дополнительную функциональность, например, кнопку Play для подкастов. (платный)

Genesis Framework –фреймворк для wordpress. (платный)

WordPress SEO by Yoast – seo плагин.

Ответы на вопросы.

Обращение в службу поддержки

Инструкция по установке

Если у Вас есть вопросы, задавайте их на , или ниже в комментариях.

W3 Total Cache improves the SEO and user experience of your site by increasing website performance, reducing load times via features like content delivery network (CDN) integration and the latest best practices.

The only web host agnostic Web Performance Optimization (WPO) framework for WordPress trusted by millions of publishers, web developers, and web hosts worldwide for more than a decade.

ПРЕИМУЩЕСТВА

  • Improvements in search engine result page rankings, especially for mobile-friendly websites and sites that use SSL
  • At least 10x improvement in overall site performance (Grade A in WebPagetest or significant Google Page Speed improvements) when fully configured
  • Improved conversion rates and «site performance » which affect your site’s rank on Google.com
  • «Instant» repeat page views: browser caching
  • Optimized progressive render: pages start rendering quickly and can be interacted with more quickly
  • Reduced page load time: increased visitor time on site; visitors view more pages
  • Improved web server performance; sustain high traffic periods
  • Up to 80% bandwidth savings via minify and HTTP compression of HTML, CSS, JavaScript and feeds

ОСНОВНЫЕ ВОЗМОЖНОСТИ

  • Compatible with shared hosting, virtual private / dedicated servers and dedicated servers / clusters
  • Transparent content delivery network (CDN) management with Media Library, theme files and WordPress itself
  • Mobile support: respective caching of pages by referrer or groups of user agents including theme switching for groups of referrers or user agents
  • Accelerated Mobile Pages (AMP) support
  • Secure Socket Layer (SSL) support
  • Caching of (minified and compressed) pages and posts in memory or on disk or on (FSD) CDN (by user agent group)
  • Caching of (minified and compressed) CSS and JavaScript in memory, on disk or on CDN
  • Caching of feeds (site, categories, tags, comments, search results) in memory or on disk or on CDN
  • Caching of search results pages (i.e. URIs with query string variables) in memory or on disk
  • Caching of database objects in memory or on disk
  • Caching of objects in memory or on disk
  • Caching of fragments in memory or on disk
  • Minification of posts and pages and feeds
  • Minification of inline, embedded or 3rd party JavaScript (with automated updates)
  • Minification of inline, embedded or 3rd party CSS (with automated updates)
  • Browser caching using cache-control, future expire headers and entity tags (ETag) with «cache-busting»
  • JavaScript grouping by template (home page, post page etc) with embed location control
  • Non-blocking JavaScript embedding
  • Import post attachments directly into the Media Library (and CDN)
  • WP-CLI support for cache purging, query string updating and more
  • Various security features
  • Caching statistics for performance insights
  • Extension framework for customization or extensibility e.g. New Relic, Cloudflare, WPML and more
  • Reverse proxy integration via Nginx or Varnish

Improve the user experience for your readers without having to change WordPress, your theme, your plugins or how you produce your content.

What users have to say:

Who do I thank for all of this?

It’s quite difficult to recall all of the innovators that have shared their thoughts, code and experiences in the blogosphere over the years, but here are some names to get you started:

  • George Schlossnagle
  • Daniel Cowgill

Please reach out to all of these people and support their projects if you’re so inclined.

Установка

  1. Deactivate and uninstall any other caching plugin you may be using. Pay special attention if you have customized the rewrite rules for fancy permalinks, have previously installed a caching plugin or have any browser caching rules as W3TC will automate management of all best practices. Also make sure wp-content/ and wp-content/uploads/ (temporarily) have 777 permissions before proceeding, e.g. in the terminal: # chmod 777 /var/www/vhosts/domain.com/httpdocs/wp-content/ using your web hosting control panel or your FTP / SSH account.
  2. Login as an administrator to your WordPress Admin account. Using the «Add New» menu option under the «Plugins» section of the navigation, you can either search for: w3 total cache or if you’ve downloaded the plugin already, click the «Upload» link, find the .zip file you download and then click «Install Now». Or you can unzip and FTP upload the plugin to your plugins directory (wp-content/plugins/). In either case, when done wp-content/plugins/w3-total-cache/ should exist.
  3. Locate and activate the plugin on the «Plugins» page. Page caching will automatically be running in basic mode. Set the permissions of wp-content and wp-content/uploads back to 755, e.g. in the terminal: # chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/ .
  4. Now click the «Settings» link to proceed to the «General Settings» tab; in most cases, «disk enhanced» mode for page cache is a «good» starting point.
  5. The «Compatibility mode» option found in the advanced section of the «Page Cache Settings» tab will enable functionality that optimizes the interoperablity of caching with WordPress, is disabled by default, but highly recommended. Years of testing in hundreds of thousands of installations have helped us learn how to make caching behave well with WordPress. The tradeoff is that disk enhanced page cache performance under load tests will be decreased by ~20% at scale.
  6. Recommended: On the «Minify Settings» tab, all of the recommended settings are preset. If auto mode causes issues with your web site’s layout, switch to manual mode and use the help button to simplify discovery of your CSS and JS files and groups. Pay close attention to the method and location of your JS group embeddings. See the plugin’s FAQ for more information on usage.
  7. Recommended: On the «Browser Cache» tab, HTTP compression is enabled by default. Make sure to enable other options to suit your goals.
  8. Recommended: If you already have a content delivery network (CDN) provider, proceed to the «Content Delivery Network» tab and populate the fields and set your preferences. If you do not use the Media Library, you will need to import your images etc into the default locations. Use the Media Library Import Tool on the «Content Delivery Network» tab to perform this task. If you do not have a CDN provider, you can still improve your site’s performance using the «Self-hosted» method. On your own server, create a subdomain and matching DNS Zone record; e.g. static.domain.com and configure FTP options on the «Content Delivery Network» tab accordingly. Be sure to FTP upload the appropriate files, using the available upload buttons.
  9. Optional: On the «Database Cache» tab, the recommended settings are preset. If using a shared hosting account use the «disk» method with caution, the response time of the disk may not be fast enough, so this option is disabled by default. Try object caching instead for shared hosting.
  10. Optional: On the «Object Cache» tab, all of the recommended settings are preset. If using a shared hosting account use the «disk» method with caution, the response time of the disk may not be fast enough, so this option is disabled by default. Test this option with and without database cache to ensure that it provides a performance increase.
  11. Optional: On the «User Agent Groups» tab, specify any user agents, like mobile phones if a mobile theme is used.

Часто задаваемые вопросы

Why does speed matter?

Search engines like Google, measure and factor in the speed of web sites in their ranking algorithm. When they recommend a site they want to make sure users find what they’re looking for quickly. So in effect you and Google should have the same objective.

Speed is among the most significant success factors web sites face. In fact, your site’s speed directly affects your income (revenue) — it’s a fact. Some high traffic sites conducted research and uncovered the following:

  • Google.com: +500 ms (speed decrease) -> -20% traffic loss
  • Yahoo.com: +400 ms (speed decrease) -> -5-9% full-page traffic loss (visitor left before the page finished loading)
  • Amazon.com: +100 ms (speed decrease) -> -1% sales loss

A thousandth of a second is not a long time, yet the impact is quite significant. Even if you’re not a large company (or just hope to become one), a loss is still a loss. However, there is a solution to this problem, take advantage.

Many of the other consequences of poor performance were discovered more than a decade ago:

  • Lower perceived credibility (Fogg et al. 2001)
  • Lower perceived quality (Bouch, Kuchinsky, and Bhatti 2000)
  • Increased user frustration (Ceaparu et al. 2004)
  • Increased blood pressure (Scheirer et al. 2002)
  • Reduced flow rates (Novak, Hoffman, and Yung 200)
  • Reduced conversion rates (Akamai 2007)
  • Increased exit rates (Nielsen 2000)
  • Are perceived as less interesting (Ramsay, Barbesi, and Preece 1998)
  • Are perceived as less attractive (Skadberg and Kimmel 2004)
Is this plugin server cluster and load balancer friendly?

Yes, built from the ground up with scale and current hosting paradigms in mind.

What is the purpose of the «Media Library Import» tool and how do I use it?

The media library import tool is for old or «messy» WordPress installations that have attachments (images etc in posts or pages) scattered about the web server or «hot linked» to 3rd party sites instead of properly using the media library.

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.

How do I find the JS and CSS to optimize (minify) them with this plugin?

Use the «Help» button available on the Minify settings tab. Once open, the tool will look for and populate the CSS and JS files used in each template of the site for the active theme. To then add a file to the minify settings, click the checkbox next to that file. The embed location of JS files can also be specified to improve page render performance. Minify settings for all installed themes can be managed from the tool as well by selecting the theme from the drop down menu. Once done configuring minify settings, click the apply and close button, then save settings in the Minify settings tab.

I don’t understand what a CDN has to do with caching, that’s completely different, no?

Technically no, a CDN is a high performance cache that stores static assets (your theme files, media library etc) in various locations throughout the world in order to provide low latency access to them by readers in those regions.

How do I use an Origin Pull (Mirror) CDN?

Login to your CDN providers control panel or account management area. Following any set up steps they provide, create a new «pull zone» or «bucket» for your site’s domain name. If there’s a set up wizard or any troubleshooting tips your provider offers, be sure to review them. In the CDN tab of the plugin, enter the hostname your CDN provider provided in the «replace site’s hostname with» field. You should always do a quick check by opening a test file from the CDN hostname, e.g. http://cdn.domain.com/favicon.ico. Troubleshoot with your CDN provider until this test is successful.

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.

How do I configure Amazon Simple Storage Service (Amazon S3) or Amazon CloudFront as my CDN?

Участники и разработчики

«W3 Total Cache» - проект с открытым исходным кодом. В развитие плагина внесли свой вклад следующие участники:

Участники

Журнал изменений

0.9.7.2

  • Fixed fatal error during media file upload with CDN module active
  • Fixed removal of empty values, JSON encoded string in attribute, trailing quote at end of tag, and the handling of anchors in HTML minify
  • Fixed undefined index warning
  • Fixed fatal error when purging CDN using full site delivery

0.9.7.1

  • Fixed undefined variable notice
  • Fixed «No such file or directory» warning
  • Fixed writing to PHP error log rather than WordPress debug log
  • Fixed default referrer policy should be «no-referrer-when-downgrade»
  • Fixed php_flag error related to browser cache, using ini_set instead
  • Fixed CloudFlare IPv6 check undefined offset
  • Fixed Undefined constant WP_ROOT
  • Fixed frame-ancestors being overwritten by frame-src
  • Fixed missing semicolon in nginx configuration
  • Fixed HTTP/2 URLs handling for browser cache and CDN modules
  • Fixed display of CDN debug information
  • Fixed CSS Minification with Google Fonts when included via «Include external files/libraries» and non-latin character-sets are loaded
  • Fixed media query string not updating when all caches were purged
  • Fixed double slash with ABSPATH if file exists
  • Fixed setting max-age and expires header simultaneously
  • Fixed SASL detection for PECL Memcached
  • Fixed handling of manually entered objects to be purged on CDN
  • Fixed query string handling in Nginx
  • Improved error handling with Cloudfront
  • Improved page cache logging
  • Improved multi-tenant support for memory-based caching engines
  • Improved CSS minification
  • Improved purge behavior for changed media objects when using CDN
  • Improved compatibility with sitemap plugins
  • Added support for Memcached for Nginx
  • Added support for caching webm files
  • Added Brotli HTTP compression support
  • Added StackPath full site delivery support
  • Added wc_session to the list of ignored query stems for improved WooCommerce compatibility

0.9.7

  • Fixed minified files not being hosted by CDN when enabled if «host minified files» is disabled
  • Fixed warning thrown when purge all was selected (via nigrosimone)
  • Fixed undefined offset error in fragment cache
  • Fixed MaxCDN test button failure when debug mode is enabled
  • Fixed purging of feeds when cache feeds option is enabeld
  • Improved handling of errors when full site delivery isn’t set
  • Improved nginx.conf to support xml caching
  • Improved nginx.conf to support HSTS for static files
  • Improved minify’s handling of query strings
  • Improved database caching, frequent wp_options no longer flush posts or comments data
  • Improved Limelight Networks CDN integration
  • Improved FAQ, they’re now hosted in the GitHub public repository
  • Improved handling for /
  • Added flushing of AMP pages

0.9.5.2

  • Fixed security issue by protecting configuration data by adding .php to relevant files
  • Fixed security issue with the creation of dot folders that could be abused
  • Fixed handling HTTP compression for uncached pages
  • Fixed handling of .svgz files
  • Added expiration headers to webP images
  • Added support for Microsoft Azure’s latest API
  • Added ability to cache WP Admin. Recommended setting, is off. (Improved WP Admin performance with object caching enabled)
  • Added HTTP/2 Push support for minified files
  • Added option management support for wp-cli
  • Improved handling of uncompressed minified files
  • Improved handling of purging of modified pages / posts
  • Improved compatibility with Rackspace Cloud Files
  • Improved initial CDN configuration reliability
  • Improved reliability of object caching
  • Improved PHP 7.0 compatibility
  • Improved PHP 4.3 compatibility
  • Improved HTTP/2 support
  • Improved CSS embed handling
  • Improved reliability of object cache, transients now fallback to database
  • Improved handling of cached http compressed objects

0.9.5.1

  • Fixed missing namespace, which caused issues with other implementations of Google APIs
  • Fixed handling Cloudflare zone list being incomplete for users with many zones
  • Added extension to support Accelerated Mobile Pages (AMP)
  • Added notification for users that are still using PHP 5.2 (end of life in 2011)
  • Improved default settings
  • Improved compatibility with Yoast SEO sitemap caching
  • Improved compatability with Jetpack
  • Improved directory handling on IIS
  • Improved backwards compatibility for 3rd party implementations against legacy W3TC functions

0.9.5

  • Fixed XSS vulnerability
  • Fixed issues with dismissing overlays
  • Fixed handling of tilde in URLs
  • Fixed issue with HTTP compression header when using mfunc calls
  • Fixed cache ID issue with minify in network mode
  • Fixed rare issue of caching empty document when some PHP errors occur in themes or plugins
  • Fixed caching of query strings
  • Added support for APCu Opcode Cache
  • Added support for Redis
  • Added support for Google Drive
  • Added support for Amazon S3-compatible stroage services
  • Added support for PECL memcached
  • Added support for srcset elements
  • Added support for Rackspace CDN Origin Pull
  • Added support for minification of external fonts
  • Added support for WOFF2 font format
  • Added support for FTPS (FTP-SSL, S-FTP)
  • Added YUI Compressor’s PHP Port of the CSS minifier
  • Added Narcissus’ JS minifier
  • Added purge of parent page when attachments are added or updated
  • Added Highwinds CDN provider
  • Added «Validate Timestamps» option for compatible opcode caches functions like apc.stat are enabled
  • Added Full Site Delivery for Pro subscribers
  • Added HTTP Strict Transport Security (HSTS) support
  • Added a sample extension for developers to reference
  • Added Rackspace Cloud Files Multi-Region Support
  • Added more support for exclusions to database cache
  • Added more optionality to minifiers
  • Added WPML Performance Extension
  • Added use of namespace which creates mininum dependency on version PHP 5.3
  • Improved PHP 5.6 compatibility
  • Improved PHP 7 compatibility
  • Improved performance menu in admin bar, including purging of specific cache engines and more
  • Improved SSL interoperability
  • Improved reliablity of test buttons
  • Improved nomenclature of caching files for higher cache hit rates
  • Improved nginx compatibility
  • Improved WP CLI support
  • Improved Cloudflare compatibility (now using latest APIs), Cloudflare must be re-authorized
  • Improved AWS API compatibility (now using latest APIs)
  • Improved Rackspace Cloud Files compatibility (now using latest APIs)
  • Improved page cache purge for extensions like cloudflare and other reverse proxy use cases
  • Improved extension framework functionality
  • Improved compatibility of headers like ETag and content encoding
  • Improved template fragment caching
  • Improved notifications, warnings and errors
  • Improved moble user agents detection
  • Improved security with nonces and form elements
  • Improved security throughout the codebase
  • Improved detail of debug messages
  • Improved Amazon SNS security (validation)
  • Improved minify’s ability to match script tags without type attribute

0.9.4

  • Fixed undefined w3tc_button_link
  • Fixed support and other form submissions
  • Fixed extension enabled key error
  • Fixed Test CDN errors
  • Fixed trailing slashes in custom wp content path and Minify
  • Fixed WP_PLUGIN_DIR not being available when object-cache.php is loaded and W3TC constant not set
  • Fixed Minify Auto and restructuring of JS code placement on page
  • Fixed remove / replace drop in file on plugins page
  • Fixed false positive check for legacy code
  • Fixed deprecated wpdb escape
  • Fixed Fragment Caching and APC anomalies
  • Fixed cached configs causing 500 error on interrupted file writes
  • Fixed readfile errors on servers with the functionality disabled
  • Fixed false positives for license key verification
  • Fixed debug information not printed on cached pages
  • Fixed backwards compatibility and flushing and added doing it wrong notification
  • Fixed «Prevent caching of objects after settings change»
  • Fixed «Use late init» being shown as enabled with Disc:Enhanced
  • Fixed missing param in APC cache method declaration
  • Fixed user roles property not begin an array
  • Fixed adding empty Vary header
  • Fixed notice on failed upgrade licencing check
  • Fixed Database Cache description text
  • Fixed duplicate bb10 agents
  • Fixed settings link in Minify Auto notification
  • Fixed notice with undefined constant
  • Fixed nginx configuration and Referrer, User Groups setting
  • Fixed Genesis settings and Suhosin field name limit error
  • Fixed Genesis and Fragment Caching (caching categories etc)
  • Fixed CDN being enabled when creating NetDNA / MaxCDN pull zone
  • Fixed NewRelic related notice in compatibility popup
  • Fixed trailing slash issue in filename to url conversion
  • Fixed issue with wp in subdirectory and relative minimal manual urls
  • Fixed issue with widget styling
  • Fixed issue with Purge All button action
  • Fixed issue with exporting of settings
  • Fixed issue with plugin interferring with preview theme
  • Fixed issue with malformed config files
  • Added caching of list of posts pages (tags, categories etc) to Genesis extension a long with flush it checkbox
  • Added typecasting on expiration time in object cache drop-in
  • Added capability check for save options
  • Added FeedBurner extension
  • Added woff support to Browser Cache
  • Added new CloudFlare IPs
  • Added support for WordPress defined charset and collate in CDN queue table creation
  • Added WordPress SEO by Yoast extension
  • Added *.less to CDN theme uploads and MIME
  • Added default settings for MaxCDN Pull Zone creation
  • Added call to change MaxCDN canonical header setting to match plugin setting
  • Added one button default pull zone creation to MaxCDN without refresh
  • Added MaxCDN authorization validation
  • Added whitelist IPs notification for MaxCDN
  • Added support for use of existing zones without refresh
  • Added new mime types
  • Added support for separate domains for frontend and admin backend
  • Added CloudFlare as an extension
  • Added nofollow to blogroll links
  • Added DEV mode support to PRO version
  • Added EDGE MODE functionality
  • Improved wrapper functions in plugins.php for plugin / theme authors
  • Improved reliability of NetDNA / MaxCDN API calls by using WP HTTP and not cURL
  • Improved Fragment Caching debug information
  • Improved preview mode, removed query string requirement
  • Improved FAQ structure
  • Improved empty minify/pgcache cache notification when using CDN
  • Improved default settings for MaxCDN zone creation
  • Improved CDN queue performance
  • Improved blogmap url sanitation
  • Improved MaxCDN automatic zone creation process
  • Improved license key saving and Pro mode activation on Pro license purchases
  • Updated EDGE MODE: Full site mirroring support for MaxCDN
  • Updated translations

Как я писала в предыдущей статье, в моей жизни, помимо хакерских нападений на блог, происходит много хорошего и светлого. Рука помощи, протянутая Романом Теличко как будто случайно, а на самом деле неслучайно, – только одно из таких событий (вот ссылка на его сайт http://romantelychko.com — можете познакомиться с тем, чем занимается Роман). Справедливости ради, должна сразу сказать, что не только он один примчался учить меня уму-разуму, как поставить надежную защиту блогу. Но позвольте не смешивать все и всех, потому что сегодня расскажу, какой он дал мне мастер-класс по настройке плагина W3Total Cache и проиллюстрирую его же скриншотами. Невероятно, но в Интернете оказалось очень много людей, которые борются с . Роман — один из них.

Прошу учесть, что никакой теории о плагине и его функциях здесь не будет. Cache и есть Cache. Его нужно чистить, но способов есть много, глубина разная и эффективность тоже.

Если вы давно хотите установить плагин W 3 Total Cache, то эта статья как раз для вас. Как скачать плагин, все знают:

ПЛАГИНЫ – ДОБАВИТЬ НОВЫЙ – ввести в окно поиска W3 TOTAL CACHE – ЗАГРУЗИТЬ — УСТАНОВИТЬ – АКТИВИРОВАТЬ

Но!!! «Единственная проблема в том, что настройка этого плагина часто зависит от возможностей и настроек как сервера, так и вообще сайта, на котором это всё происходит. Помните, что я спросил у Вас в первую очередь? Какие методы кэширования доступны?» (цитата из переписки с Романом). Будем считать это отправной точкой. Данные настройки плагина W3 TOTAL CACHE в описанном случае выполняются при методе кэширования Opcode: Alternative PHP Cache (APC) . Возможные варианты (методы) у себя я увидела, уже установив плагин. И еще один очень важный момент: не давайте странице переводиться на русский , если работаете в браузере Google Chrome. Плагины любят родной язык.

Настраивается каждый блок отдельно, и в каждом нужно сохранять измененные параметры. Порядок неважен. Можно идти сверху вниз по порядку, но не забывать сохранять произведенные настройки, прежде чем перейти к следующему блоку. При наведении в меню на название плагина Performance появляется выпадающее меню его блоков.

01. Меню плагина w 3 cache

В таком порядке и пойдем.

Это общий вид того, что у нас должно получиться после настройки плагина w 3 total cache.

03. Page Cache — w3 total cache

Теперь и в минимизации проставляем те же параметры, что и на изображении.

04. Minify — W3 Total Cache

Дошли до базы данных. Обратите внимание, что время по умолчанию выставлено другое. Ставим свое.

05. Database Cache — W3 Total Cache

Объекты кэширования. Здесь тоже не забываем сверять указанное по умолчанию время и исправляем на свое:

06. Object Cache — W3 Total Cache

Вот и все. Когда все настройки будут выполнены, нужно подняться наверх страницы и включить плагин. Обязательно через просмотр. Сначала нажимаем preview , а только потом, когда в соседней вкладке страница полностью успешно загрузится, deploy . И так после внесения дополнительных изменений в любой блок. Просмотреть — включить! Заодно можете просмотреть код страницы моего блога и своего. Если разницу найдете, напишите в комментарии, пожалуйста. Это я так утонченно хвастаюсь. 🙂

Всем желаю грамотно оптимизированных блогов, высокой степени безопасности в Интернете и побольше хороших людей рядом!

P.S. Пожалуйста, обратите внимание на комментарии. Там обсуждается много нужных нюансов.

А еще предлагаю на минутку отвлечься от серьезных дел и прочитать , которое было мной написано в рамках конкурса, проводимого Devaka (Сергеем Кокшаровым) и биржей Rotapost на стыке 2014 и 2015 годов. 🙂 Приз хочу!!!

  • Большое количество опций делает этот плагин очень гибким для тонкой настройки; его иногда называют фреймворком для увеличения производительности работы сайта
  • Плагин мега популярный, активно развивается, и по нему вы всегда можете найти огромное количество информации в сети
  • Работает хорошо на обычном виртуальном хостинге, но на выделенном хостинге вы можете выжать еще больше из него, а для экстремалов есть про версия.
  • Русского языка нет, но вы можете найти в интернете готовый перевод — W3 Total Cache русский язык

Кэширование сайта позволяет во много раз ускорить загрузку страниц, и плагин W3 Total Cache один из лучших настраиваемых вариантов для этого.

Предварительные действия до установки плагина

  1. Отключите другие установленные плагины кэширования , чтобы избежать возможных конфликтов
  2. Сделайте бэкап базы данных (чтобы чувствовать себя спокойно)
  3. Проверьте текущую скорость загрузки сайта через сервис gtmetrix.com, чтобы вы могли отследить изменения после оптимизации.

Установка и настройка W3 Total Cache

Плагин устанавливается обычным способом. Скачать его можно отсюда https://wordpress.org/plugins/w3-total-cache/ , или через поиск в консоли wordpress.

После активации вы увидите большое меню с самыми разнообразными опциями внутри. Не пугайтесь, большинство из них вы скорее всего не будете использовать. А если вы администрируете свой выделенный сервер, то вы легко разберетесь с продвинутыми настройками.

На странице Performance -> Install выложена инструкция по базовой установке.

Если вы хотите увидеть более детальное описание модулей и настроек W3 Total Cache — рекомендую посетить переведенное руководство из 3-х частей на сайте wpcafe.org

Здесь мы рассмотрим минимальный набор настроек, чтобы запустить плагин и работу кэширования.

  1. Установите права 755 на каталог wp-content/ — в консоли, в файловом менеджере, или в ftp клиенте, любым удобным для вас способом.
# chmod 755 /var/www/vhosts/domain.com/httpdocs/wp-content/
  1. На вкладке основные настройки Performance -> General выберите способ кэширования для страниц, базы данных и минификации. В большинстве случаев «хорошими» настройками являются — метод disk enhanced для кэширования страниц, метод disk для минификации и для кэширования базы данных.
  2. Compatibility Mode — опция режима совместимости в секции Page Cache Settings включает функциональность, которая оптимизирует взаимодействие кэширования с WordPress. По умолчанию опция отключена, но очень рекомендуется.
  3. На вкладке Minify все рекомендуемые опции предустановлены.
  1. На вкладке Browser Cache HTTP компрессия включена по умолчанию. Включите другие опции, чтобы настроить кэш и сроки хранения в браузере.

  1. Если к вашему сайту подключен CDN, перейдите на вкладку Content Delivery Network для настройки необходимых полей.

Если у вас нет CDN провайдера, вы можете настроить self-hosted — вариант на своем сервере. Прочитайте для этого FAQ

  1. На вкладке Database Cache рекомендуемые настройки предустановлены
  2. На вкладке Object Cache рекомендуемые настройки предустановлены

На последних двух вкладках используйте метод disk с осторожностью, потому что на виртуальном хостинге это может стать причиной снижения производительности

Вы видите, опций и настроек много, но вам необязательно на каждую из них жать.

Напоследок, многих волнует такой вопрос:

Что лучше — W3 Total Cache или WP Super Cache?

Ответ — оба хорошо выполняют свою задачу.

Их главное отличие:

  • WP Super Cache позиционируется как простое решение для кэширования WordPress, хотя в нём тоже есть раздел с некоторыми продвинутыми настройками
  • W3 Total Cache — однозначно более настраиваемый и гибкий плагин. Особенно, если вы держите сайт на выделенном сервере, он может оказаться вашим лучшим вариантом для выдачи оптимальной производительности.

Расскажу вам «секрет» как сделать выбор между ними. Не опирайтесь на чужие мнения. Ваш сайт может быть уникальным в коде, дизайне и характеристиках сервера.

  • установите первый плагин, включите кэш, откройте несколько страниц, убедитесь визуально в его работе. Измерьте производительность сайта , сделайте скриншоты по возможности.
  • установите второй плагин, включите кэш и рекомендуемые модули, протестируйте работу сайта и затем снова измерьте скорость.
  • сравните с результатами первого и оставьте тот, который выдал для вас наилучшие результаты
  • не забывайте, что есть другие плагины на рынке, платные и бесплатные — почитайте документацию к ним или протестируйте самостоятельно.

У меня бывали случаи, когда один плагин кэширования конфликтовал с другими установленными плагинами , а второй работал отлично. И наоборот.

Поэтому, лучший плагин — это тот, который у вас работает и стабильно обеспечивает оптимальную производительность из коробки.

Экспериментируйте, оставляйте комментарии и делитесь результатами.

Хотите узнать секрет быстрой загрузки сайтов на Wordpress? Помимо хорошего хостинга и правильно написанных расширений, используйте кэширование и CDN (content delivery network, сеть доставки контента). К примеру, плагин W3 Total Cache.

В этой статье мы рассмотрим установку и настройку W3 Total Cache для максимальной производительности. Также приведем пример комбинации использования кэширования и сервисов CDN для максимального ускорения загрузки сайта.

Перед тем, как начать, рекомендуется проверить производительность сайта с помощью онлайновых сервисов Google Page Speed и/или Pingdom Tools . Это следует сделать для того, чтобы сравнить прежние результаты с теми, что получатся после всех настроек.

Что такое W3 Total Cache?

W3 Total Cache это наиболее полный и быстрый плагин для оптимизации производительности в Wordpress. Это подтверждено использованием его на многих популярных сайтах, таких как: AT&T, Mashable, Smashing Magazine и на многих других. W3 Total Cache увеличивает скорость работы сайта путем повышения производительности сервера, кэширования всех аспектов сайта, уменьшения времени отклика и предоставления прозрачной интеграции с сетью доставки контента (CDN).

Установка W3 Total Cache в WordPress

Перед установкой W3 Total Cache, убедитесь, что удалены все другие кэширующие плагины. Если этого не сделать, то при активации плагина W3 Total Cache появится ошибка.

Для установки потребуется выполнить нехитрый порядок действий:

Перейдите в административную панель сайта и нажмите на «Плагины »→ «Добавить новый ». В строке поиска наберите «W3 Total Cache » и увидите его в результатах поиска:


Нажмите на кнопку «Установить », после установки активируйте плагин.

Параметры и настройка W3 Total Cache

W3 Total Cache - это очень мощный плагин и у него очень много настраиваемых параметров. С одной стороны - это хорошо, для тех, кто знает как их использовать - это золотая жила. Начинающих же вебмастеров эти параметры могут смутить. Мы подробно рассмотрим все разделы настроек, чтобы вы могли оптимально настроить W3 Total Cache. Начнем с общих параметров.

Общие настройки

Для того, чтобы перейти на страницу с общими настройками, нажмите на меню «Кеширование» в административной панели Wordpress. На ней представлены общие настройки плагина. Убедитесь, что находитесь в общих настройках, а не на странице консоли плагина W3 Total Cache.


Что такое кэширование страницы?

Первый из параметров, который можно увидеть - кэширование страницы. Он отвечает за создание кэшированной статический страницы для каждой загруженной страницы сайта. Таким образом, вместо постоянной генерации динамической страницы, посетителю будет открываться закэшированная статическая страница. На изображении ниже можно увидеть как работает эта функция:


На картинке изображено следующее: обычно когда пользователь заходит на сайт, Wordpress запускает PHP-­скрипты и запросы к базе данных для вывода запрошенной страницы. Тогда PHP обрабатывает данные и создает страницу. Этот процесс вывода страницы потребляет определенные ресурсы сервера. Включение возможности кэширования страницы позволяет пропустить процесс генерации страницы.

Для виртуального хостинга, который использует большинство начинающих владельцев сайта, рекомендуется использовать метод кэширования страниц «Disk:Enhanced». Выберите пункт «кэширование страниц» и сохраните параметры.


Большинству этого будет достаточно. Данное руководство - для вебмастеров начинающего уровня. И мы сознательно пропускаем все расширенные настройки кэширования страниц, подразумевая, что настройки по умолчанию вполне достаточны.

Мы также пропускаем минификацию, кэширование запросов к БД и кэширование объектов. По причине того, что не все серверы предоставляют возможности для использования этих параметров.

Следующий пункт настроек - браузерный кэш.

Что такое браузерный кэш?

Каждый раз, когда посетитель заходит на сайт, его браузер скачивает все изображения, css­ файлы, js­скрипты и другие статические файлы со страницы сайта во временную директорию. Это делается для того, чтобы при переходе на другую страницу файлы не скачивались повторно, а открывались из кеша браузера. Это ускоряет загрузку сайта и экономит трафик.

Параметр браузерного кэширования в W3 Total Cache позволяет указать время хранения закэшированных элементов. При учете, что вы не меняете логотип каждый день, кэширование на 24 часа не причинит никаких неудобств. Просто выделите этот параметр и сохраните. После этого перейдите в «Кэширование» => «Браузерное кэш» для установки прочих настроек.


Как вы можете увидеть на скриншоте выше, мы включили все пункты за исключением параметра обработки 404 ошибки. При сохранении параметров, все настройки на странице будут сохранены по умолчанию.

В этой простой настройке Wordpress, остальные параметры включены по умолчанию. Все, что было рассмотрено выше, будет хорошо работать на большинстве серверах, предоставляющих веб­-хостинг. Но у W3 Total Cache есть еще и другие параметры. Постараемся рассмотреть, что они из себя представляют и почему их не включают на всех сайтах.

Минификация

Минификация - это просто уменьшение размера статических файлов вашего сайта для экономии каждого килобайта по возможности. Но использование минификации файлов «налету» увеличивает потребление ресурсов сервера. И в некоторых случаях полезность использования этой возможности может быть сомнительна. Да и к тому же, не на каждом сервере существует возможность ее использования без предварительной настройки.

Кеширование запросов к БД

Кеширование запросов к БД уменьшает нагрузку сервера путем кэширования SQL­ запросов. Это уменьшает или исключает время на обработку запросов к базе данных, которая может быть незаметна на большинстве маленьких сайтов. Но включение этой функции может увеличить нагрузку на сам сервер. Поэтому в некоторых случаях лучше использовать встроенные буферы кэширования самого сервера баз данных. Многие хостинг-­провайдеры не рекомендуют использовать это кэширование.

Кеширование объектов

Если у вас сайт с большим количеством динамических объектов, то следует посмотреть в сторону возможности кэширование объектов с помощью W3 Total Cache . В основном это используется при сложных, ресурсоемких запросах к базе данных. Для большинства начинающих вебмастеров эта функция не требуется.

Итак, когда все настроено, будет хорошо сделать резервную копию настроек W3 Total Cache. Для этого следует перейти на страницу общих настроек плагина W3 Total Cache в раздел «Настройки импорта / экспорта» и нажать «Скачать файл параметров».

На этом краткое руководство по установке и настройке W3 Total Cache можно считать оконченным. Надеемся, что эта статья была для вас полезной, и ваш сайт снова обрел крылья.