AI助手支持GPT4.0
This plugin takes all scripts and stylesheets that have been added via wp_enqueue_script and wp_enqueue_style
wp_enqueue_script
wp_enqueue_style
此插件采用通过 wp_enqueue_script code>和 wp_enqueue_style code> 添加的所有脚本和样式表and automatically concatenates and minifies them into logical groups.和自动 em>串联并将它们最小化为逻辑组。For example, scripts in the footer get grouped例如,页脚中的脚本会分组together and styles with the same media (e.g. print) get minified together.并使用相同媒体(例如 print code>)的样式一起缩小。Minification is done via WP-Cron in order缩小是通过WP-Cron按顺序进行的to prevent race conditions and to ensure that the minification process does not slow down page responses.以防止出现竞争情况并确保缩小过程不会减慢页面响应。 p>This is a reincarnation and rewrite of the Optimize Scripts plugin,这是优化脚本插件的转世和重写,which this plugin now supersedes.现在该插件已取代。 p>Features: 功能: strong> p>Minified sources are stored in the WP Options table so no special filesystem access is required.缩小的源存储在WP Options表中,因此不需要特殊的文件系统访问。 li>Endpoint for minified requests is at /_minified, which can be configured.缩小请求的端点位于 / _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li> ul>Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
wp_enqueue_script code>和 wp_enqueue_style code> 添加的所有脚本和样式表and automatically concatenates and minifies them into logical groups.和自动 em>串联并将它们最小化为逻辑组。For example, scripts in the footer get grouped例如,页脚中的脚本会分组together and styles with the same media (e.g. print) get minified together.并使用相同媒体(例如 print code>)的样式一起缩小。Minification is done via WP-Cron in order缩小是通过WP-Cron按顺序进行的to prevent race conditions and to ensure that the minification process does not slow down page responses.以防止出现竞争情况并确保缩小过程不会减慢页面响应。 p>This is a reincarnation and rewrite of the Optimize Scripts plugin,这是优化脚本插件的转世和重写,which this plugin now supersedes.现在该插件已取代。 p>Features: 功能: strong> p>Minified sources are stored in the WP Options table so no special filesystem access is required.缩小的源存储在WP Options表中,因此不需要特殊的文件系统访问。 li>Endpoint for minified requests is at /_minified, which can be configured.缩小请求的端点位于 / _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li> ul>Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
wp_enqueue_style code> 添加的所有脚本和样式表and automatically concatenates and minifies them into logical groups.和自动 em>串联并将它们最小化为逻辑组。For example, scripts in the footer get grouped例如,页脚中的脚本会分组together and styles with the same media (e.g. print) get minified together.并使用相同媒体(例如 print code>)的样式一起缩小。Minification is done via WP-Cron in order缩小是通过WP-Cron按顺序进行的to prevent race conditions and to ensure that the minification process does not slow down page responses.以防止出现竞争情况并确保缩小过程不会减慢页面响应。 p>This is a reincarnation and rewrite of the Optimize Scripts plugin,这是优化脚本插件的转世和重写,which this plugin now supersedes.现在该插件已取代。 p>Features: 功能: strong> p>Minified sources are stored in the WP Options table so no special filesystem access is required.缩小的源存储在WP Options表中,因此不需要特殊的文件系统访问。 li>Endpoint for minified requests is at /_minified, which can be configured.缩小请求的端点位于 / _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li> ul>Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
and automatically concatenates and minifies them into logical groups.
和自动 em>串联并将它们最小化为逻辑组。For example, scripts in the footer get grouped例如,页脚中的脚本会分组together and styles with the same media (e.g. print) get minified together.并使用相同媒体(例如 print code>)的样式一起缩小。Minification is done via WP-Cron in order缩小是通过WP-Cron按顺序进行的to prevent race conditions and to ensure that the minification process does not slow down page responses.以防止出现竞争情况并确保缩小过程不会减慢页面响应。 p>This is a reincarnation and rewrite of the Optimize Scripts plugin,这是优化脚本插件的转世和重写,which this plugin now supersedes.现在该插件已取代。 p>Features: 功能: strong> p>Minified sources are stored in the WP Options table so no special filesystem access is required.缩小的源存储在WP Options表中,因此不需要特殊的文件系统访问。 li>Endpoint for minified requests is at /_minified, which can be configured.缩小请求的端点位于 / _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li> ul>Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
For example, scripts in the footer get grouped
例如,页脚中的脚本会分组
together and styles with the same media (e.g. print) get minified together.
print
并使用相同媒体(例如 print code>)的样式一起缩小。Minification is done via WP-Cron in order缩小是通过WP-Cron按顺序进行的to prevent race conditions and to ensure that the minification process does not slow down page responses.以防止出现竞争情况并确保缩小过程不会减慢页面响应。 p>This is a reincarnation and rewrite of the Optimize Scripts plugin,这是优化脚本插件的转世和重写,which this plugin now supersedes.现在该插件已取代。 p>Features: 功能: strong> p>Minified sources are stored in the WP Options table so no special filesystem access is required.缩小的源存储在WP Options表中,因此不需要特殊的文件系统访问。 li>Endpoint for minified requests is at /_minified, which can be configured.缩小请求的端点位于 / _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li> ul>Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
print code>)的样式一起缩小。Minification is done via WP-Cron in order缩小是通过WP-Cron按顺序进行的to prevent race conditions and to ensure that the minification process does not slow down page responses.以防止出现竞争情况并确保缩小过程不会减慢页面响应。 p>This is a reincarnation and rewrite of the Optimize Scripts plugin,这是优化脚本插件的转世和重写,which this plugin now supersedes.现在该插件已取代。 p>Features: 功能: strong> p>Minified sources are stored in the WP Options table so no special filesystem access is required.缩小的源存储在WP Options表中,因此不需要特殊的文件系统访问。 li>Endpoint for minified requests is at /_minified, which can be configured.缩小请求的端点位于 / _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li> ul>Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
Minification is done via WP-Cron in order
缩小是通过WP-Cron按顺序进行的
to prevent race conditions and to ensure that the minification process does not slow down page responses.
以防止出现竞争情况并确保缩小过程不会减慢页面响应。 p>
This is a reincarnation and rewrite of the Optimize Scripts plugin,
这是优化脚本插件的转世和重写,
which this plugin now supersedes.
现在该插件已取代。 p>
Features:
功能: strong> p>Minified sources are stored in the WP Options table so no special filesystem access is required.缩小的源存储在WP Options表中,因此不需要特殊的文件系统访问。 li>Endpoint for minified requests is at /_minified, which can be configured.缩小请求的端点位于 / _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li> ul>Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
/_minified
/ _ minified code>,可以对其进行配置。 li>Admin page for taking inventory of minified scripts and stylesheets, with methods for expiring or purging the cached data.管理页面,用于清查缩小的脚本和样式表,以及用于过期或清除缓存数据的方法。 li>Dependencies which must not be minified may be excluded via the dependency_minification_excluded filter.可以通过 dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
dependency_minification_excluded
dependency_minification_excluded code>过滤器排除必须减少的依赖关系。 li>Dependencies hosted on other domains are by default excluded, but this behavior can be changed by filtering the default_exclude_remote_dependencies option via the dependency_minification_options filter, or on a case-by-默认情况下,不排除在其他域上托管的依赖关系,但是可以通过 dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.通过前面提到的过滤器确定案例依据。 li>By default excludes external scripts from being concatenated and minified, but they can be opted in via the dependency_minification_excluded filter.默认情况下,外部脚本不会被串联和缩小,但可以通过 dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
default_exclude_remote_dependencies
dependency_minification_options
默认情况下,不排除
dependency_minification_options code>过滤器过滤 default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.
default_exclude_remote_dependencies code>选项来更改此行为,case basis via the filter previously mentioned.
case basis via the filter previously mentioned.
通过前面提到的过滤器确定案例依据。 li>
dependency_minification_excluded code>过滤器进行选择。 li>The length of time that a minified source is cached defaults to 1 month, but can be configured via the cache_control_max_age_cache option.最小化源的缓存时间长度默认为1个月,但可以通过 cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
cache_control_max_age_cache
cache_control_max_age_cache code>选项进行配置。 li>If a minified source is not available yet, the page source will note that the dependency minification process is pending.如果尚无缩小源,页面源将指出依赖关系缩小过程正在等待中。 li>Any errors that occur during minification will be shown on the frontend in comments if the show_error_messages option is enabled;如果启用了 show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
show_error_messages
show_error_messages code>选项,则缩小过程中发生的任何错误都会显示在前端的注释中。such errors are enabled by default if WP_DEBUG.
such errors are enabled by default if WP_DEBUG.
WP_DEBUG
如果 WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
WP_DEBUG code>,则默认启用此类错误。 li>If the minification process errors out, the original unminified sources are served and the error is cached for 1 hour (by default, configured via cache_control_max_age_error) to prevent back-to-back crons from continually attempting如果缩小过程出错,则将提供原始未缩小的源,并将错误缓存1小时(默认情况下,通过 cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.永久减少。 li>Cached minified sources are served with Last-Modified and ETag responses headers and requests will honor If-None-Match and 缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
cache_control_max_age_error
cache_control_max_age_error code>配置),以防止背对背cron不断尝试to minify in perpetuity.
to minify in perpetuity.
永久减少。 li>
Last-Modified
ETag
If-None-Match
缓存的缩小源由 Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
Last-Modified code>和 ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).
ETag code>响应标头提供,并且请求将接受 If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).
If-None-Match code>和 If-Modified-Since to return 304 Not Modified responses (configurable via the allow_not_modified_responses option).
If-Modified-Since
304 Not Modified
allow_not_modified_responses
If-Modified-Since code>返回 304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
304 Not Modified code>响应(可通过 allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
allow_not_modified_responses code>选项配置)。 li>Data attached to scripts (e.g. via wp_localize_script) is also concatenated together and attached to the newly-minified script.附加到脚本的数据(例如通过 wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
wp_localize_script
wp_localize_script code>)也被连接在一起,并附加到新缩小的脚本。 li>WP-Cron is utilized to initiate the minification process in order to prevent race conditions, and to ensure that page responses aren’t slowed down. WP-Cron用于启动缩小过程,以防止出现竞争情况,并确保不会降低页面响应速度。 li>Stale minified scripts and stylesheets remain until replaced by refreshed ones;过时的,精简的脚本和样式表会一直保留,直到被刷新的脚本和样式表所取代;this ensures that full-page caches which reference stale minified sources won’t result in any 404s.这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>Can serve compressed responses with gzip or deflate.可以使用 gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
this ensures that full-page caches which reference stale minified sources won’t result in any 404s.
这样可以确保引用过时的最小源的全页缓存不会产生任何404。 li>
gzip
deflate
gzip code>或 deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
deflate code>提供压缩的响应。 li>Transforms relatives paths in stylesheets (e.g. background-images) to absolute ones, so that they don’t 404.将样式表(例如背景图片)中的亲戚路径转换为绝对路径,以免它们变为404。 li>
ul>
Development of this plugin is done on GitHub. 此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.在进入插件论坛之前,请参阅此处报告的问题。 strong >> p>If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
此插件的开发已在GitHub上 完成。Pull requests welcome.拉请求欢迎。Please see issues reported there before going to the plugin forum.
Pull requests welcome.
拉请求欢迎。
Please see issues reported there before going to the plugin forum.
在进入插件论坛之前,请参阅此处报告的问题。 strong
>
> p>
If you are using Nginx with the default Varying Vagrant Vagrants config, you'll want to remove css|js from this rule in nginx-wp-common.conf
css|js
nginx-wp-common.conf
如果您将Nginx与默认的Varaging Vagrant Vagrants配置一起使用,则需要从 nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
nginx-wp-common.conf code>中的此规则中删除 css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
css | js code> (or remove the rule altogether):(或完全删除该规则): p># Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
(or remove the rule altogether):
(或完全删除该规则): p>
# Handle all static assets by serving the file directly. #通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}} code> pre>
#通过直接提供文件来处理所有静态资产。Add directives添加指令# to send expires headers and turn off 404 error logging.#发送过期标头并关闭404错误日志记录。location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { 位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ { expires 24h; 过期24小时; log_not_found off;log_not_found关闭;}}
Add directives
添加指令
# to send expires headers and turn off 404 error logging.
#发送过期标头并关闭404错误日志记录。
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
位置〜* \。(js | css | png | jpg | jpeg | gif | ico)$ {
expires 24h;
过期24小时;
log_not_found off;
log_not_found关闭;
}
code> pre>
原文出处:http://www.sanshu.cn/a/10633.html
群主管理都是支付大佬