hint > cmds directive
The following are the "hint > cmds" directive coding rules.
cmd
Specifies the name of the "lua" directive that sets the conditions.
Type
Scalar (String)
Value
directive name | Specify the name of the directive. This cannot be omitted. |
Example
hint:
cmds:
- cmd: wp shorten url
apply
Specifies the path or the conditions to be applied to the "lua" directive.
If more than one is specified, the OR condition will be used.
Type
Mapping
apply > path
Specifies the path to be applied to the "lua" directive.
Type
Sequence (String)
Value
path | Specify the path to be applied the "lua" directive by regular expressions. The "worker" directive will be applied by default to all resources except for paths specified in "global_exclude" in the PST configuration file. |
Example
hint:
cmds:
- cmd: wp shorten url
apply:
path:
- ^/
apply > if
Specifies the conditions to be applied to the "lua" directive. If this is not set, this directive will be applied by default to all resources except for paths specified in "global_exclude" in the PST configuration file.
Type
Sequence (String)
Value
is_kusanagi_pc | Specify access from a PC browser as a condition. |
is_kusanagi_mobile | Specify access from a mobile browser as a condition. |
is_kusanagi_tablet | Specify access from a tablet browser as a condition. |
Example
hint:
cmds:
- cmd: wp shorten url
apply:
if:
- is_kusanagi_pc
exclude
Specifies the path or conditions to be excluded from application to the "lua" directive.
If more than one is specified, the OR condition will be used.
Type
Mapping
exclude > path
Specify the path to be excluded from application to the "lua" directive.
Type
Sequence (String)
Value
path | Specify the path to be excluded from application to the "lua" directive by regular expressions. The "worker" directive will be applied by default to all resources except for paths specified in "global_exclude" in the PST configuration file. |
Example
hint:
cmds:
- cmd: wp shorten url
exclude:
path:
- ^/
exclude > if
Specifies the conditions to be excluded from application to the "lua" directive. If this is not set, this directive will be applied by default to all resources except for paths specified in "global_exclude" in the PST configuration file.
Type
Sequence (String)
Value
is_kusanagi_pc | Specify access from a PC browser as an exclusion condition. |
is_kusanagi_mobile | Specify access from a mobile browser as an exclusion condition. |
is_kusanagi_tablet | Specify access from a tablet browser as an exclusion condition. |
Example
hint:
cmds:
- cmd: wp shorten url
exclude:
if:
- is_kusanagi_pc
hint > scripts directive
The following are the "hint > scripts" directive coding rules.
path
Specifies the path to the script or style sheet resource to be set with an "engagement delay" condition. The directive must specify either the path or the needle. If neither is specified, the directive will be ignored.
Type
Scalar (String)
Value
path | Specify the path to apply "engagement delay". |
Example
hint:
scripts:
- path: /wp-content/themes/twentytwenty/print.css
needle
Specify the needle to the inline script or style sheet resource to be set with an "engagement delay" condition. The directive must specify either the path or the needle. If neither is specified, the directive will be ignored.
Type
Scalar (String)
Value
needle | Specify the inline needle to apply to "engagement delay". |
Example
hint:
scripts:
- needle: document.documentElement
apply
Specifies the path or condition to which "engagement delay" must be applied.
Type
Mapping
apply > path
Specifies the path to which "engagement delay" must be applied.
Type
Sequence (String)
Value
path | Specify the path to which "engagement delay" must be applied by regular expressions. By default, Strategic AI "David" will determine the application based on the optimization strategy. |
Example
hint:
scripts:
- script: /wp-content/themes/twentytwenty/print.css
apply:
path:
- ^/
apply > if
Specifies the condition to which "engagement delay" must be applied. If the conditions are not specified, Strategic AI "David" will determine application based on the optimization strategy.
Type
Sequence (String)
Value
is_kusanagi_pc | Specify access from a PC browser as a condition. |
is_kusanagi_mobile | Specify access from a mobile browser as a condition. |
is_kusanagi_tablet | Specify access from a tablet browser as a condition. |
Example
hint:
scripts:
- script: /wp-content/themes/twentytwenty/print.css
apply:
if:
- is_kusanagi_pc
exclude
Specifies the paths or conditions to be excluded from "engagement delay".
Type
Mapping
exclude > path
Specifies the paths to be excluded from "engagement delay".
Type
Sequence (String)
Value
path | Specify the path not to be applied to "engagement delay" by regular expressions. By default, Strategic AI will determine the application based on the optimization strategy. |
Example
hint:
scripts:
- script: /wp-content/themes/twentytwenty/print.css
exclude:
path:
- ^/
exclude > if
Specifies the conditions to be excluded from application to "engagement delay". If the conditions are not specified, Strategic AI "David" will determine application based on the optimization strategy.
Type
Sequence (String)
Value
is_kusanagi_pc | Specify access from a PC browser as an exclusion condition. |
is_kusanagi_mobile | Specify access from a mobile browser as an exclusion condition. |
is_kusanagi_tablet | Specify access from a tablet browser as an exclusion condition. |
Example
hint:
scripts:
- script: /wp-content/themes/twentytwenty/print.css
exclude:
if:
- is_kusanagi_pc
hint > features directive
The following are the "hint > features" directive coding rules.
feature
Specifies the feature to be set for an optimization strategy. If you do not specify this feature, the directive will be ignored.
Type
Scalar (String)
Value
lazy load | Specify "lazy load". |
proxy | Specify "proxy". |
webfont | Specify "webfont". |
engagement delay | Specify "engagement delay". |
Example
hint:
features:
- feature: lazy load
enable
Sets Enable/Disable for optimization strategies.
Type
Scalar (Boolean)
Value
true | Enable The default setting is "enabled". |
false | Disable |
Example
hint:
features:
- feature: lazy load
enable: false