Swift Performance

Swift Performance / plugin documentation version 1.2.5


Table of Content

  • Item Name : Swift Performance
  • Item Version : Version 1.2.5
  • Minumum Required : WordPress 4.0+, PHP 5.3+
  • Author by : SWTE
  • Support via Email : support@swte.ch

Generating critical CSS needs some CPU. If your site is running on low-end hosting, when your resources are very limited this function may won't work (depends on your theme/plugins)

Installation #back to top

Install via WordPress

You can install the downloaded ZIP file via WordPress admin.
  1. Go to Plugins > Add new > Upload plugin
  2. Click to Browse and select the downloaded ZIP file
  3. Click to install
  4. Activate the plugin

Install via FTP

You also can install the plugin via FTP
  1. Unzip the downloaded ZIP file
  2. Upload the swift-performance folder to wp-content/plugins
  3. Login to WordPress admin
  4. Go to Plugins and activate the plugin

General settings #back to top

General

Purchase Key
Optionally you can set your purchase key, after this you will be able to update the plugin from WordPress admin, and you will be able to use the image optimizer and the Compute API. If you are using trial key a small notice will be added to your footer on frontend.

Hide Footprints
Prevent to add "Swift Performance" response header and HTML comment

Use Compute API
If you specified a valid purchase key you will be able to use the Compute API. It will speed up merging process and decrease CPU usage.

Enable Remote Cron
With this option you can get real a cronjob instead of normal WP Cron. It can be useful if you would like to run cronjobs (eg delete expired cache) but all of your frontend page are cached.

Remote Cron Frequency
You can set Remote Cron frequency here. It can be daily, twice a day or hourly

Limit Simultaneous Threads
Limit maximum simultaneous threads. It can be useful on shared hosting environment to avoid 508 errors.

Maximum Threads
Number of maximum simultaneous threads. Default is 10.

Debug Log
You can enable debug logging here. You will see the current day's logs on the Plugin dashboard, others will be stored in the specified log folder.

Loglevel
You can choose the log level. It can be All/Warning/Error. All will contain notices, warnings and errors. Warning will contain only warnings and errors, and error will contain only errors.

Log Path
You can specify a folder where the logs will be saved. You can use a folder outside public html for better security.

Tweaks

Normalize Static Resources
Remove unnecessary query string from CSS, JS and image files. It is recommended to use this option for better browser caching

Prefetch DNS
If you enable this option, the plugin will add prefetch meta tags. All domains will be collected from styles and the HTML as well.

Collect domains from scripts
If you enable this option the plugin will collect domains for DNS prefetching from javascripts files as well.

Exclude DNS Prefetch
You can exclude specific domains from DNS prefetching.

Heartbeat

With this option you can manage the frequency of the WordPress Heartbeat API (or even disable it), and decrease server resource usage

Disable Heartbeat
You can disable Heartbeat API on specific admin pages.

Heartbeat Frequency
Override heartbeat frequency in seconds.

Google Analytics

Bypass Google Analytics
If you enable this option your site will send pageviews and events with AJAX requests in the background using the Google Analytics Measurement protocol

Tracking ID
You can specify here the Google Analytics tracking ID. You will find the tracking ID in Analytics Admin panel.

IP Source
If your site is behind a proxy (eg. Cloudflare or Nginx reverse proxy) the IP source should be set properly. The plugin will detect and suggest the proper source.

Delay Collect
Send the collect AJAX request only after the first user interaction (eg mousemove, scroll, or touchstart)

Media #back to top

Images

Optimize Images
Enable if you would like to optimize the images during the upload using the our Image Optimization API service. Already uploaded images can be optimized on the plugin dashboard.

Enable Lossy Optimization (recommended)
Enable slightly lossy optimization for Image Optimizer. Lossy optimization will be quicker than lossless.

Keep Original Images
If you enable this option you will be able to keep and restore original images. Of course it will use some extra space on your server.

Inline Small Images
Use base64 encoded inlined images for small images

LazyLoad
Enable if you would like lazyload for images. If lazylaod is enabled the images will be replaced with low quality placeholders and will be loaded only when they almost appeared in the viewport.

Exclude Images
Exclude images from being lazyloaded if one of these strings is found in the URL.

Load Images on User Interaction
Enable if you would like to load full images only on user interaction (mouse move, sroll, touchstart)

Inline Lazy Load Images
Use base64 encoded inlined images for lazyload images

Force Responsive Images
Force all images to use srcset attribute if it is possible

Embeds

LazyLoad
Enable if you would like lazyload for iframes. If lazylaod is enabled the iframes will be loaded only when they almost appeared in the viewport.

Exclude Iframes
Exclude iframes from being lazyloaded if one of these strings is found in the match.

Load Iframes on User Interaction
Enable if you would like to load iframes only on user interaction (mouse move, sroll, touchstart)

Asset Manager #back to top

General

Merge Assets for Logged in Users
Enable if you would like to merge styles and scripts for logged in users as well. NOTE: Regarding, that all logged in users have separate cache for every pages, if you enable this option may your site will be slower on first pageload for logged in users. So even if this option is available for special cases, usually you shouldn't use it.

Merge Assets in Background
In some cases the generating the critical CSS takes some time. If you enable this option the plugin will generate it in the background.

Minify HTML
Remove unnecessary whitespaces and Minify the source code.

Disable Emojis
Even if you are not using emojis on your site WordPress will load emojis. With this option you can prevent this, which will reduce the number requests and the total page size as well.

Scripts

Merge Scripts (recommended)
Merge javascript files to reduce number of HTML requests

Async Execute (recommended)
You can reduce number of requests if you enable merge scripts option, however if you have one huge javascript file your first javascripts can run only if the whole file was downloaded. With this option you can execute merged javascript files asynchronously, so it will be still only one request, however as soon a part received it will be executed immediately (while the other parts are loading).

Exclude 3rd Party Scripts
Exclude 3rd party scripts from merged scripts. This option is available, but it isn't recommended to use. It can be useful if you would like to decrease your server load, and let some files to load from somewhere else, however for this you should use CDN.

Exclude Scripts
Exclude scripts from being merged if one of these strings is found in the match. If it is necessary (eg there is a conflict) you can exclude scripts. Usually you don't need this option.

Exclude Inline Scripts
This option is similar to the previous one, the only difference is that it is for inline scripts. So if one of the specified words will found in the code the script won't be merged. Usually you don't need this option.

Exclude Script Localizations
Exclude javascript localizations from merged scirpts. Regarding that localizations contains variables and personalized data you should enable this option. Otherwise you may will have separate js files for all of your pages.

Minify Javascripts
Enable minify for javascript. With this option you can decrease the request size a lot, it is a must.

Minify with API
Use Compute API for minify. If you have an invalid script on your site, it can break the merged script file. In that case you can enable this option, our API will try to fix the invalid script. Regarding that this minify method can be slower, use this option only if default JS minify cause javascript errors. Usually you don't need this option.

Proxy 3rd Party Assets
Proxy 3rd party javascript and CSS files which created by javascript (eg: Google Analytics). It can improve the browser caching (set more reasonable expiry time), however it can break scripts sometime. Use it carefully. Note: to solve analytics.js expiry header issue you should use Google Analytics Bypass instead

Exclude 3rd Party Assets
Exclude scripts from being proxied if one of these strings is found in the match. With this option you can skip problematic 3rd party scripts/styles and proxy the rest.

Print merged scripts inline
You should use this function only if WordPress can't write files and you would like to cache everything with Memcached. It is a really rare situation, usually you don't need it.

Lazy Load Scripts
Load scripts only after first user interaction, if one of these strings is found in the match. You can use it for slow chats, analytics, etc.

Styles

Merge Styles (recommended)
Merge CSS files to reduce number of HTML requests. Highly recommended to use.

Generate Critical CSS
Swift Performance can generate the Critical CSS (or Critical Path) on the fly for every pages. What is Critical CSS?

Compress CSS
Extra compress for critical CSS. This feature will shorten CSS class names as well.

Remove Keyframes
Remove CSS animations from critical CSS

Print critical CSS inline (recommended)
Enable if you would like to print the critical CSS into the header, instead of a seperated CSS file. Regarding that the critical CSS is already blocking resource you should inline it in <head>

Print full CSS inline
Enable if you would like to print the merged CSS into the footer, instead of a seperated CSS file. You should use this function only if WordPress can't write files and you would like to cache everything with Memcached. It is a really rare situation, usually you don't need it.

Minify CSS
Remove unnecessary whitespaces and minify the CSS code.

Bypass CSS Import (recommended)
If you enable this option your merged CSS will include imported CSS files as well.

Exclude 3rd Party CSS
Exclude 3rd party CSS files (eg: Google Fonts CSS) from merged styles. Usually you don't need this option

Exclude Styles
If you would like to exclude styles from the merged CSS you can use this option. Usually you don't need this option

Include Styles
Include styles manually. With this option you can preload CSS files what would be loaded later with javascript. It will also block the second load from JS.

Caching #back to top

General

Caching Mode
Disk cache with rewrites is faster, however sometimes you can't edit the .htaccess file or the Nginx config so Disk cache with PHP is also available as a fallback.

Cache Path
You can specify a cache path for disk cache. It will be wp-content/cache by default.

Cache Expiry Mode
You can choose the traditional Time Based cache expiry, or Intelligent cache expiry option. Time Based is the best choice for most sites and webshops. WooCommerce, BBPress and Buddypress support is included. Choose intelligent mode if some of your pages are modified frequently (eg: live scores)

Cache Expiry Time
If you choose the Time Based cache expiry you can specify the expiry time here (in seconds).

Garbage Collection Interval
How often should check the expired cached pages (in seconds)

Clear Page Cache After Post
Select pages where cache should be cleared after publish/update post. With this option you can clear for example the homepage's cache after you posted a new article.

Resource saving mode
This option will reduce intelligent cache check requests. Recommended for limited resource severs. You also should use this option if there are dynamic generated parts (eg tokens) in the source.

Disable Instant Reload
If you disable instant reload the plugin will override the cache if intelligent cache detect changes, however it won't replace the page content instantly for the user.

Enable Caching for logged in users
This option is available only for Intelligent cache expiry. Please note, that it can increase the total cache size, depending on the count of your users.

Enable Mobile Device Support
You can create separate cache for mobile devices, it can be useful if your site not just responsive, but it has a separate mobile theme/layout. Usually you don't need this option.

Enable Browser Cache
If you enable this option it will generate htacess/nginx rules for browser cache. If you are using Apache and htaccess is writable rules will be automatically added.

Enable Gzip
If you enable this option it will generate htacess/nginx rules for gzip compression. If you are using Apache and htaccess is writable rules will be automatically added.

Exclude Pages
You can exclude any pages from cache here. Some pages like WooCommerce cart, checkout, etc won't be cached by default.

Exclude URLs
URLs which contains any strings from this list won't be cached.

Exclude Content Parts
Pages which contains that string won't be cached. Use leading/trailing # for regex

Exclude User Agents
For those user agents which contains that string the site won't be cached. Use leading/trailing # for regex

Exclude Crawlers
For those user agents which are known crawlers the site won't be cached.

Enable Dynamic Caching
If you enable this option you can specify cacheable $_GET and $_POST requests

Cacheable Dynamic Requests
Specify $_GET and/or $_POST keys what should be cached. Eg: "s" to cache search requests

Cacheable AJAX Actions
With this option you can cache resource-intensive AJAX requests (eg AJAX search). You should specify the action names here.

Cloudflare

Enable Auto Purge
If you enable this option the plugin will purge the cache on Cloudflare as well when it clears plugin cache. It is recommended to enable this option if you are using Cloudflare with caching.

Cloudflare Account E-mail
Your e-mail address which related to the Cloudflare account what you are using for the site.

Cloudflare API Key
The generated API key for your Cloudflare account. Global API key

Varnish

Enable Auto Purge
If you enable this option the plugin will purge Varnish cache as well when it clears plugin cache. It is recommended to enable this option if you are using Varnish cache.

Custom Host
If you are using proxy (eg: Cloudflare) you may will need this option

Appcache

With Appcache you can select specific pages (or even the full site), which will be preloaded for the visitor on the first view using browser's Application Cache. It can drastically speed up navigation on your site. You can configure Appcache separately for desktop and mobile

Enable Appcache for Desktop
You can enable Appcache for desktop devices.

Appcache Mode
Appcache mode can be "Full site" or "Specific pages". If you select Full site you can specify exceptions, if you select specific pages you can select the pages (or page rules) which should be preloaded and cached with Appcache

Desktop Max Size
Appcache maximum full size on desktop devices. That is the size what the visitor's browser will download and cache. Default is 100Mb for desktop and 5Mb for mobile devices.

Exclude Pages
You can select pages which shouldn't be cached with Appcache. This option will be available if you select Full site as Appcache Mode.

Exclude Strings
You can exclude pages from Appcache if one of these strings is found in the URL. This option will be available if you select Full site as Appcache Mode.

Include Pages
You can select pages which should be cached with Appcache. This option will be available if you select Specific pages as Appcache Mode.

Include Strings
Cache pages with Appcache only if one of these strings is found in the URL. This option will be available if you select Specific pages as Appcache Mode.

Enable Appcache for Mobile
You can enable Appcache separately for mobile devices. All other options are the same as for desktop

If you would like to increase Appcache size for mobile devices to more than 5Mb, please note that the browser may will prompt the user for permission to use storage. This limit is undocumented, and highly variable. It is recommended to use the default 5Mb limit for mobile devices.

CDN #back to top

CDN Hostname
You can specify a main CDN hostname. If you doesn't specify more hostnames it will be used for all static contents.

CDN Hostname for Javascript
Use different hostname for javascript files

CDN Hostname for Media files
Use different hostname for media files

Enable CDN on SSL
You can specify different hostname(s) for SSL, or leave them blank for use the same host on HTTP and SSL

MAXCDN Support

If you are using MAXCDN and set the API you will be able to purge CDN from wp-admin. If you are using a different CDN you can ignore these fields

MAXCDN Alias
If you are using MAXCDN you can specify your Alias here

MAXCDN Consumer Key
If you are using MAXCDN you can specify your Consumer Key here

MAXCDN Consumer Secret
If you are using MAXCDN you can specify your Consumer Secret here