[WordPress] 外掛分享: Remove Cookies From Static Resources

WordPress 外掛 Remove Cookies From Static Resources 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Remove Cookies From Static Resources」是 2023-03-21 上架。
  • 目前有 100 個安裝啟用數。
  • 上一次更新是 2025-04-18,距離現在已有 14 天。
  • 外掛最低要求 WordPress 4.6 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
  • 有 1 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

giuse |

外掛標籤

cleanup | performance |

內容簡介

以下是文章的要點:
- 當瀏覽器請求靜態資源時,例如圖像、樣式表或腳本時,它會將所有 cookie 發送到伺服器,每個請求都是如此。
- 一種解決此問題的方法是從無 cookie 的子域​​名提供靜態資源,但有時您可能不希望僅為靜態資產創建一個子域​​名,並向 WordPress 發送從子域​​名獲取它們的指示。
- 將設置 crossorigin= "anonymous",讓瀏覽器不會在請求靜態資源時發送其 cookie。
- 這種解決方案僅適用於支持 crossorigin 屬性的現代瀏覽器。
- 這個插件沒有任何設置,不會增加其他 HTTP 請求或數據庫查詢。
- 如果您的網站需要從靜態資源傳輸大量數據,從靜態資源中刪除 cookie 可以改善性能。
- 刪除靜態資源中的 cookie 並不總是能提高性能,它只會在某些情況下有所幫助。在大多數情況下,資源本身才是致性能問題的原因。
- 安裝 Remove Cookies From Static Resources 應用程式即可。

原文外掛簡介

It removes cookies from the requests to static resources for modern browsers.
When the browser requests a static resource such as an image, a stylesheet, or a script, it sends to the server all the cookies, and it does it at every request.
If your page requests 10 scripts, then it sends 10 times the cookies.
As you have probably heard, a way to solve this issue is to serve the static resources from a cookies-free subdomain.
The cookies-free subdomain is a possible solution, but sometimes you have no wish to create a subdomain only for the static assets and give instructions to WordPress for fetching them from the subdomain.
Moreover, why don’t we solve this issue directly at the root? Is the browser that sends cookies to the server, so let’s address this issue with the browser.
This is exactly what Remove Cookies From Static Resources does. It instructs the browser to don’t send its cookies when it requests static resources.
However, this solution will work only with the modern browsers that support the crossorigin attribute.
The plugin simply adds crossorigin=”anonymous” to all the requested scripts, links, and images. Nothing else.
This plugin will not work for old browsers. It will also not work for all those resources that are added with JavaScript, or CSS.
This plugin has no settings. No additional HTTP requests, no additional database queries. It consumes practically zero.
You should see an improvement in performance if yor website requests many static resources sending big data through the cookies.
In all other cases you don’t need this plugin, as you would not need to serve static resources from a cookies-free domain.
Removing cookies from static resources is not always the performance saver that some people think. This is totally not true in many cases.
In most cases the cookies aren’t the cause of bad peformance, but the resources itselves. In those cases, it would be more effective totally removing the resources that you don’t need everywhere with Freesoul Deactivate Plugins.
Of course, removing cookies from static resources improves also the privacy of your visitors.
As a side note, removing cookies form static resources with this plugin will have no impact on the score given by some speed meters.
The speed meters only check if the static resources are requested to free-cookies domains, but they don’t check the crossorigin paramenter.
How to remove cookies from static resources

Install Remove Cookies From Static Resources
Done!

How to understand if I really need to remove cookies from static resources

Go to your website
Right-click => Ispect => Console => write document.cookie.length and press enter
If you see a number higher than 5000 you probably need this plugin to save bandwidth due to big data transfers through the cookies. For lower numbers you will probably not need this plugin.

Does removing cookies from static resources always improve the performance?
Absolutely not! It improves the performance only if yor website requests many HTTP requests due to static resources and it writes many data to the browser through the cookies.
Limits

This plugin doesn’t work for old browsers that don’t support the crossorigin attribute
This plugin doesn’t work for all those resources that are added with JavaScript or CSS, and probably it will never work in those cases, neither with future versions of the plugin.

You may also be interested in

All Pages In Customize
Asset Preloader
Basic Security
Blog Page Editor For Elementor
Body Class By Url Parameter
Change Class In Viewport
Change Debug Log Location
Collect Browser Info
Content No Cache
Css Selectors
Custom Spinner For Woocommerce
Defer Transictional Emails For Woocommerce
Direct Password Reset Link
Disable Fatal Error Handler
Disable Global Style
Editor Cleanup For Avada
Editor Cleanup For Divi Builder
Editor Cleanup For Elementor
Editor Cleanup For Flatsome
Editor Cleanup For Oxygen
Editor Cleanup For Wpbakery
Email No Bot
Essential Form
Export Without Shortcodes
Freesoul Deactivate Plugins
Freesoul Responsive Check
Freesoul Switch Theme
Freeze
Frontend As Any User
Frontype
Hide Link
Inline Image Base64
Lazy Load Control For Elementor
Load Video On Click
Mu Manager
No Spam In Backend
Oracle Cards
Page Detector
Passe Partout
Plugversions
Progress Bar Correction For Lifterlms
Rename Plugins Folder
Resource Not Found Placeholder
Restore Paypal Standard For Woocommerce
Save Single File
Specific Content For Mobile
Top Bar Links
Update Page Cache
Website Information

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Remove Cookies From Static Resources」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.0.1 | trunk |

延伸相關外掛(你可能也想知道)

  • WP-Sweep 》這個外掛可以清理以下項目:, , 修改版本, 自動草稿, 已刪除評論, 未經批准的評論, 垃圾評論, 已刪除評論, 已孤立的文章元數據, 已孤立的評論元數據, 已孤立...。
  • Delete Duplicate Posts 》這個外掛可以搜尋並移除重複的文章及它們的相關資料。, 在您自己的測試網站上試試看:請點擊此連結 => https://tastewp.com/template/t6-CTt-T3P4?ni=true...。
  • WP Clean Up 》WP Clean Up 可以幫助我們通過刪除「修訂版本」、「草稿」、「自動草稿」、「已審核評論」、「垃圾評論」、「已刪除評論」、「孤立的文章元數據」、「孤立的...。
  • Simple Revisions Delete 》這個外掛允許您逐個或一次性刪除文章的修訂版(清除或批量動作)。與 Gutenberg(實驗性的)和經典編輯器兼容。, 它有什麼作用?, Simple Revisions Delete ...。
  • Image Regenerate & Select Crop 》該外掛可管理圖像的高級設置,覆蓋本機的中等大小和大型裁剪選項,註冊新的自定義圖像尺寸。該外掛添加了兩個自定義按鈕,讓您可以重新生成和裁剪圖像,提供...。
  • Freesoul Deactivate Plugins – Disable plugins on individual WordPress pages 》FDP 可讓您在特定頁面上停用外掛程式,以進行速度優化、偵錯和解決問題。它可適用於所有頁面、文章、定製文章(可公開查詢)、歸檔和後端頁面。, , 使用 FDP...。
  • Optimize Images Resizing 》如果你曾經對 WordPress 處理圖片大小調整感到煩惱,這個外掛就是為你而設的。, 這個外掛的作用是優化圖片處理方式,只有在必要時才會調整圖片大小。也就是說...。
  • AAA Option Optimizer 》,
      ,
    • 該外掛追踪頁面上使用的自動載入選項,並在頁面渲染結束時存儲該數據。它保留一個已使用的選項數組。在管理頁面上,它...。
    • DNUI 》不再維護, 該外掛已不再維護,您可以在 https://wordpress.org/plugins/ultimate-media-cleaner/ 查看新開發的版本, 我會稍等一段時間再刪除該存儲庫, 現在可...。
    • Specific Content For Mobile – Customize the mobile version without redirections 》「Specific Content For Mobile」外掛可以讓你針對手機版頁面和文章創建特定的內容。若某些頁面需要有不同的內容,這款外掛就非常適合你使用。雖然擁有一個完...。
    • Image Cleanup 》你曾在WordPress中縮放或裁剪上傳的圖片嗎?你曾經試過不同的圖像生成外掛嗎?你曾經更改或添加過各種媒體圖像大小嗎?如果是,你的內容文件夾可能充滿了未使...。
    • Templ Optimizer 》Templ Optimizer 是一款能夠讓您輕鬆優化您的網站並提高其性能的外掛程式。, 我們在 Templ 這家公司透過這些年的經驗,已經針對 1000 多個 WordPress 網站進...。
    • Cleanup Action Scheduler 》使用此 WordPress 外掛可以刪除 Action Scheduler 事件,以避免資料庫表格過大。, 功能:, , 刪除按鈕以刪除所有動作[已完成,已失敗]。請參見屏幕截圖。, , 1...。
    • whatwedo ACF Cleaner 》我們會對所選擇的文章類型逐一檢查使用的 ACF 群組,接下來會從已刪除的群組中刪除所有數據。, 這裡提供一個「偵測」選項,可以預覽會被刪除多少字段。在實際...。
    • Database Toolset 》資料庫工具集可以通過刪除所有孤兒或不需要的條目,例如“短期數據”、“修訂版”、“自動草稿”、“孤立的文章元”等,幫助您保持資料庫的清潔和優化。, 此外,資料...。

文章
Filter
Apply Filters
Mastodon