Title: Resource Versioning
Author: Viktor Szépe
Published: <strong>2015 年 7 月 15 日</strong>
Last modified: 2018 年 7 月 21 日

---

搜尋外掛

![](https://ps.w.org/resource-versioning/assets/banner-772x250.png?rev=1199655)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/resource-versioning/assets/icon-256x256.png?rev=1199655)

# Resource Versioning

 由 [Viktor Szépe](https://profiles.wordpress.org/szepeviktor/) 開發

[下載](https://downloads.wordpress.org/plugin/resource-versioning.0.3.0.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/resource-versioning/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/resource-versioning/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/resource-versioning/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/resource-versioning/#developers)

 [技術支援](https://wordpress.org/support/plugin/resource-versioning/)

## 外掛說明

“It’s important to make resources (images, scripts, stylesheets, etc.) cacheable.”

[Steve Souders](http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/)

It is much easier to use a CDN without Query String Parameters.
 This plugins alters
only local resources’ URL-s. The `ver` Query String Parameter will be inserted into
the filename.

For example `jquery.min.js?ver=1.10` becomes `jquery.min.110.js`.

To reverse this in the web server add this line to your nginx config:

    ```
    server {
        location ~ ^(.+)\.\d\d+\.(js|css|png|jpg|jpeg|gif|ico)$ {
            #try_files $uri $1.$2 /index.php?$args;
            try_files $uri $1.$2 =404;
        }
    }
    ```

Or to your Apache configuration or `.htaccess` file.

    ```
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)\.\d\d+\.(js|css|png|jpg|jpeg|gif|ico)$ $1.$2 [NC,L]
    ```

#### Testing the plugin before live usage

You can test the plugin by replacing the two `add_filter()` calls with this

    ```
    require_once( dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/wp-load.php' );
    wp();
    echo o1_revving_src( $argv[1] ) . PHP_EOL;
    ```

Then start it from CLI: `php revving.php <TEST-URL>`

#### Links

Development of this plugin goes on on [GitHub](https://github.com/szepeviktor/resource-versioning).

## 安裝方式

This section describes how to install the plugin and get it working.

 1. Upload `revving.php` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 常見問題集

  How to remove all Query String Parameters from resources?

Poorly written plugins and themes may add unwanted Query String Parameters.
 For
example `?rev=4.10`.

To drop all these parameters copy this into your `wp-config.php`:

    ```
    define( 'O1_REMOVE_ALL_QARGS', true );
    ```

## 使用者評論

![](https://secure.gravatar.com/avatar/3b49954fddcafd8dde33e96c750f034ef5ebe8753516d2bd35b87bff4e282957?
s=60&d=retro&r=g)

### 󠀁[Perfect Cache Busting Method](https://wordpress.org/support/topic/perfect-cache-busting-method/)󠁿

 [mwmcw](https://profiles.wordpress.org/mwmcw/) 2017 年 9 月 6 日

Simple to install, does what it should do. Integrates perfectly well! Thank you 
very much, Viktor!

 [ 閱讀全部 1 則使用者評論 ](https://wordpress.org/support/plugin/resource-versioning/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Resource Versioning〉的開發相關工作。

參與者

 *   [ Viktor Szépe ](https://profiles.wordpress.org/szepeviktor/)

[將〈Resource Versioning〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/resource-versioning)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/resource-versioning/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/resource-versioning/)，或透過
[RSS](https://plugins.trac.wordpress.org/log/resource-versioning/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/resource-versioning/)。

## 變更記錄

#### 0.3.0

 * Support cdn-ified URL-s without protocol schema.
 * More structured code.

#### 0.2.0

 * Strengthen stability.
 * Support cdn-ified URL-s.

#### 0.1.3

 * FIX: Use proper WordPress function for content URL.

#### 0.1.2

 * FIX: Don’t run on admin.

#### 0.1.1

 * FIX: External URL detection.

#### 0.1.0

 * Initial relase without multisite support.

## 中繼資料

 *  版本 **0.3.0**
 *  最後更新 **8 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 4.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.9.29**
 *  語言
 * [English (US)](https://wordpress.org/plugins/resource-versioning/)
 * 標籤:
 * [Apache](https://tw.wordpress.org/plugins/tags/apache/)[file](https://tw.wordpress.org/plugins/tags/file/)
   [nginx](https://tw.wordpress.org/plugins/tags/nginx/)[resource](https://tw.wordpress.org/plugins/tags/resource/)
   [varnish](https://tw.wordpress.org/plugins/tags/varnish/)
 *  [進階檢視](https://tw.wordpress.org/plugins/resource-versioning/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  1 個 5 星使用者評論     ](https://wordpress.org/support/plugin/resource-versioning/reviews/?filter=5)
 *  [  0 個 4 星使用者評論     ](https://wordpress.org/support/plugin/resource-versioning/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/resource-versioning/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/resource-versioning/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/resource-versioning/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/resource-versioning/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/resource-versioning/reviews/)

## 參與者

 *   [ Viktor Szépe ](https://profiles.wordpress.org/szepeviktor/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/resource-versioning/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://szepe.net/wp-donate/)