PST Configuration File (3.2.0)

Overview

This page explains how to set configuration files for WEXAL® Page Speed Technology (hereinafter referred to as "PST"). The format is YAML. It is generated in "wexal/pst.config.yaml" for each profile (for a production environment.)

In addition to PST configuration files for a production environment, PST configuration files for a staging environment can be created for verification and other purposes. For each profile, a PST configuration file for a staging environment can be created in "wexal/pst.CONFIGURATION-NAME.config.yaml". For example, "wexal/pst.stg.config.yaml".

Modifying PST Configurations

Edit Configuration Files in PST Manager

You can change PST settings from profile mode on the PST Manager dashboard. Refer to "PST Manager" for more information. Unless there is a particular reason not to, we recommend using PST Manager to configure settings.

Note, you cannot edit PST configuration files for a staging environment in PST Manager. Refer to the following "Edit Configuration Files Directly".

Edit Configuration Files Directly

When editing PST configuration files, make sure that the setting-descriptions are correct. Erroneous setting descriptions may cause problems, such as failure of the website to display.

Configuration Format

PST configuration files are written in YAML format. Refer to YAML for the basic rules and format. This section describes the nodes used in PST.

pst

Controls PST.

Type

Scalar (String)

Value

onEnable
offDisable

Example

pst: on

watch

Controls the PST monitoring process.

Type

Scalar (String)

Value

onThe profile Resource Monitoring Service will start automatically when the server starts.
offThe profile Resource Monitoring Service will not start automatically when the server starts.

Example

watch: on

tdir

Specifies the DocumentRoot in the PST profile directory. The "pst init" command will set this automatically, so usually no change is required.

Type

Scalar (String)

Value

pathSpecify the full path to the DocumentRoot in the profile directory.
The default setting is /home/kusanagi/PROFILE-NAME/DocumentRoot

Example

tdir: /home/kusanagi/profile/DocumentRoot

odir

Specifies the name of the symbolic link to the original content referenced by PST. The "pst init" command will set this automatically, so usually no change is required.

Type

Scalar (String)

Value

symbolic link nameSpecify the name of the symbolic link to the original content.
The default setting is "_wexal".

Example

odir: _wexal

timezone

Specifies the timezone referenced by PST.

Type

Scalar (String)

Value

timezone nameYou can find time zone names with the "tzselect" command.
The default timezone is Asia/Tokyo.

Example

timezone: Asia/Tokyo

protocol

Specifies the protocol PST will apply.

Type

Scalar (String)

Value

httpSet HTTP.
httpsSet HTTPS. Note, when setting https, set up also a 301 redirect from HTTP to HTTPS. Refer to the "kusanagi ssl" command to configure the redirect.

Example

protocol: https

options

Specifies the type of directives to use for PST optimization.

Type

Sequence (String)

Value

luaEnables the "lua" directive. If this is not set, directives written to "lua" nodes will be disabled.
apply_logged_in_userSpecifies "Enable" or "Disable" PST optimization for logged in users. If this is not set, PST optimization will be disabled for logged in users.

Example

options:
- lua

global_exclude

Specifies directories not to be included in PST optimization.

Type

Sequence (String)

Value

pathSpecify directories to be excluded from PST optimization by absolute path from the DocumentRoot ("tdir" node value) of the KUSANAGI profile.

Example

global_exclude:
- /_wexal
- ~$
- /\.
- /wp-admin
- /wp-includes
- /wp-content/upgrade
- /wp-content/plugins

watch_additional_exclude

Specifies directories not to be included for optimization by PST Resource Monitoring Service. Directories set in "watch_additional_exclude" are not in scope for optimization by the Resource Monitoring Service, but are in scope for other services and PST commands. Specify directories that do not require sequential optimization and that are to be optimized by batch processing, etc.

Type

Sequence (String)

Value

pathSpecify directories to be excluded from PST Resource Monitoring Service optimization by absolute path from the DocumentRoot ("tdir" node value) of the KUSANAGI profile.

Example

watch_additional_exclude:
- /wp-content/uploads

lua

Sets the PST content optimization method.

Type

Mapping

lua > dynamic

Sets the automatic generation of optimization strategies by Strategic AI "David".

Type

Mapping

lua > dynamic > enable

Specifies Enable/Disable for the automatic generation of optimization strategies by Strategic AI "David"

Type

Scalar (Boolean)

Value

trueEnable
falseDisable
The default setting is disabled.

Example

lua:
  dynamic:
    enable: true

lua > dynamic > exptime

Specifies the valid period of automatically generated optimization strategies in seconds.

Type

Scalar (Numeric)

Value

numericSpecify the valid period in seconds.
The default number of seconds is 3600

Example

lua:
  dynamic:
    exptime: 3600

lua > dynamic > config

Specifies options for automatically generating optimization strategies.

Type

Mapping

lua > dynamic > config > benchmark

Outputs the measured benchmarks to the log for the automatic generation of optimization strategies by Strategic AI "David".

Type

Scalar (Boolean)

Value

trueEnable
falseDisable
The default setting is disabled.

Example

lua:
  dynamic:
    config:
      benchmark: false

lua > dynamic > config > configname

Generates optimization strategies by Strategic AI "David" with the specified name.

Type

Scalar (String)

Value

configuration nameGenerate optimization strategies by this configuration name. The default name is unspecified (production environment).

Example

lua:
  dynamic:
    config:
      configname: stg

lua > dynamic > config > diagnosis

Outputs more details for the automatic generation of optimization strategies by Strategic AI "David".

Type

Scalar (Boolean)

Value

trueEnable
falseDisable
The default setting is disabled.

Example

lua:
  dynamic:
    config:
      diagnosis: false

lua > dynamic > config > html

Stores the content of web pages in the optimization strategy database when the optimization strategy is automatically generated by Strategic AI "David".

Type

Scalar (Boolean)

Value

trueEnable
falseDisable
The default setting is disabled.

Example

lua:
  dynamic:
    config:
      html: false

lua > dynamic > config > timeout

When the optimization strategy is automatically generated by Strategic AI "David", sets the timeout period in seconds for website analysis.

Type

Scalar (Numeric)

Value

numericSet the timeout period in seconds to analyze the web page.
If 0 is set, Strategic AI "David" will wait until there is a response from the web page.
The default timeout is 10 seconds.

Example

lua:
  dynamic:
    config:
      timeout: 10

lua > dynamic > config > voyage

Enables analysis of web pages using "puppeteer" for automatic generation of optimization strategies by Strategic AI "David".

Type

Scalar (Boolean)

Value

trueEnable
falseDisable.
If disabled, PST optimization runs faster with less resource consumption, but it cannot retrieve LCP.
The default setting is disabled.

Example

lua:
  dynamic:
    config:
      voyage: false

lua > dynamic > config > waituntil

When automatically generating optimization strategies by Strategic AI "David", specifies the event that marks the completion of web page analysis by the "puppeteer".

Type

Scalar (String)

Value

loadSpecify the “load” event. The default setting is “load”.
domcontentloadedSpecify the “domcontentloaded” event.
networkidle0Complete if there are no active network connections within 500ms.
networkidle2Complete if there are two or less active network connections within 500ms.

Example

lua:
  dynamic:
    config:
      waituntil: load

lua > dynamic > config > inspector

Enables the inspector to inspect HTML and resource by comparing the original Web page with the PST-enabled results.

Type

Scalar (Boolean)

Value

trueEnable.
If enabled, PST optimization runs with more resource consumption.
falseDisable.
The default setting is disabled.

Example

lua:
  dynamic:
    config:
      inspector: false

lua > fcache

Sets “lua” on-memory cache (L-Cache). L-Cache is only available when F-Cache is enabled in the KUSANAGI profile.

Type

Mapping

lua > fcache > enable

Sets Enable/Disable for L-Cache.

Type

Scalar (Boolean)

Value

trueEnable
falseDisable
The default setting is disabled.

Example

lua:
  fcache:
    enable: true

lua > fcache > exptime

Specifies the valid period of L-Cache in seconds.

Type

Scalar (Numeric)

Value

numericSpecify the valid period in seconds.
The default is 60 seconds.

Example

lua:
  fcache:
    exptime: 60

lua > header_filter

Specifies the "lua" directive to run when the HTTP headers are output. Note, if automatic generation of optimization strategies by Strategic AI "David" is enabled, this setting will be ignored.

Type

Sequence (Mapping)

Value

Specify the "lua" directive. Refer to "lua Directive" for more information.

Example

lua:
  header_filter:
  - cmd: add
    args:
    - 'page-speed-technology: on'

lua > body_filter

Specifies the "lua" directive to run when HTTP responses are output. Note, if automatic generation of optimization strategies by Strategic AI "David" is enabled, this setting will be ignored.

Type

Sequence (Mapping)

Value

Specify the "lua" directive. Refer to "lua Directive" for more information.

Example

lua:
  body_filter:
  - cmd: wp shorten url

worker

Sets the PST resource optimization method.

Type

Mapping

worker > images

Sets the resource optimization method for images. Note, when you change this setting, use the "pst opt image" command to execute resource optimization.

Type

Sequence (Mapping)

Value

Specify the "worker" directive. Refer to "worker Directive" for more information. You can specify multiple "worker" directives, but if the same path is specified, the first matching optimization method will be applied. If no value is set, no resource optimization will be executed on images.

Example

worker:
  images:
  - cmd: optimize
    args:
      formats:
      - png
      - jpg
      - gif
      - webp
      resize: 1920x1080
      quality: 80
      strip: true
      gif_lossy: 80
      webp_lossy: 75

worker > scripts

Sets the resource optimization method for scripts. Note, when you change this setting, use the "pst opt js" command to execute resource optimization.

Type

Sequence (Mapping)

Value

Specify the "worker" directive. Refer to "worker Directive" for more information. You can specify multiple "worker" directives, but if the same path is specified, the first matching optimization method will be applied. If no value is set, no resource optimization will be executed on scripts.

Example

worker:
  scripts:
  - cmd: optimize
    args:
      ie11: true
      ie11_ab: true

worker > stylesheets

Sets the resource optimization method for style sheets. Note, when you change this setting, use the "pst opt css" command to execute resource optimization.

Type

Sequence (Mapping)

Value

Specify the "worker" directive. Refer to "worker Directive" for more information. You can specify multiple "worker" directives, but if the same path is specified, the first matching optimization method will be applied. If no value is set, no resource optimization will be executed on style sheets.

Example

worker:
  stylesheets:
  - cmd: optimize
    args:
      ie11: true
      ie11_ab: true

overrides

To be used when you want to override PST settings under particular conditions.

Type

Sequence (Mapping)

Value

Specify the override directive. Refer to "override Directive" for more information.

Example

overrides:
- name: mobile pages
  device: mobile
  path: .
  if: 1
  node:
  - lua
  applied:
    lua:
      fcache:
        enable: 0
        exptime: 60
      header_filter:
      - cmd: wp remove header
      body_filter:
      - cmd: wp shorten url

url

Specifies the query string to be recognized as a unique URL. Basically, PST recognizes URLs that omit the query string as unique URLs. However, if you want to adjust optimization for different query strings, for example, if different pages are generated depending on the query string, use this option. This option allows PST to generate unique URLs, keeping only those that match the key and value of the specified query string. If multiple query strings are specified, an OR condition should be used.

Type

Mapping

Key

Specify the key of the query string. The key of the query string must be an exact match.

Value

Specify the value of the query string by regular expressions.

Example

url:
  user: .
  group: ^wp-

proxy

Configures the reverse proxy settings. Basically, "proxy" is set by the "pst init" command and does not need to be changed.

Type

Mapping

proxy > scheme

Sets the protocol for connecting to the original server in the case of a reverse proxy.

Type

Scalar (String)

Value

httpUse HTTP.
httpsUse HTTPS.

Example

proxy:
  scheme: https

proxy > host

Sets the original FQDN for a reverse proxy.

Type

Scalar (String)

Value

FQDNSpecify the original FQDN.

Example

proxy:
  fqdn: www.example.com

proxy > ip

Sets the original IP address for a reverse proxy.

Type

Scalar (String)

Value

IP addressSpecify the original IP address.

Example

proxy:
  ip: xxx.xxx.xxx.xxx

nano

Configures "nano". Basically, "proxy" is set by the "pst init" command and does not need to be changed.

Type

Mapping

nano > scheme

Sets the protocol for connecting to the "nano".

Type

Scalar (String)

Value

httpUse HTTP.
httpsUse HTTPS.

Example

nano:
  scheme: https

nano > host

Sets the FQDN of "nano".

Type

Scalar (String)

Value

FQDNSpecify the FQDN of "nano".

Example

nano:
  fqdn: www.example.com

hint

Configures resource hints. Resource hints allow directives to be applied only under certain conditions, or to be excluded. Basically, they are configured by PST Manager and do not need to be changed.

Type

Mapping

hint > cmds

Configures resource hints for the "lua" directive. These resource hints allow the "lua" directive to be applied only under certain conditions, or to be excluded.

Type

Sequence (Mapping)

Value

Specify the "hint" directive. Refer to "hint Directive" for more information. You can specify multiple "hint" directives and the first matching optimization method will be applied.

Example

hint:
  cmds:
  - cmd: wp shorten url
    exclude:
      path:
      - ^/

hint > scripts

Sets resource hints for the "lua" directive on "engagement delay". These resource hints allow "engagement delay" to be applied only under certain conditions, or to be excluded.

Type

Sequence (Mapping)

Value

Specify the "hint" directive. Refer to "hint Directive" for more information. You can specify multiple "hint" directives and the first matching optimization method will be applied.

Example

hint:
  scripts:
  - script: /wp-content/themes/twentytwenty/print.css
    apply:
      path:
      - .

hint > features

Configures resource hints for optimization strategies. You can set Enable/Disable for particular optimization strategies.
By default, all optimization strategies are enabled.

Type

Sequence (Mapping)

Value

Specify the "hint" directive. Refer to "hint Directive" for more information. You can specify multiple "hint" directives and the first matching optimization method will be applied.

Example

hint:
  features:
  - feature: webfont
    enable: false