內容簡介
以下為總結:
WordPress 內建快取機制,可有效減少網頁載入時間,提升網站效能,但有時也會導致過時的 CSS 或 JS 檔案被載入,導致網站顯示問題。此外掛提供解決辦法,提供載入已更新的 css 和 js 的選項。
以下為問題與答案:<br>
問題:WordPress 內建的快取機制有什麼好處?<br>
答案:WordPress 內建快取機制可有效減少網頁載入時間,提升網站效能。
問題:WordPress 內建的快取機制可能導致什麼問題?<br>
答案:快取機制有時也會導致過時的 CSS 或 JS 檔案被載入,導致網站顯示問題。
問題:此外掛提供什麼解決辦法?<br>
答案:此外掛提供選項,讓你可以載入已更新的 CSS 和 JS。
問題:此外掛有哪些核心功能?<br>
答案:此插件提供選項來啟用或停用 CSS 和 JS 快取。
外掛標籤
開發者團隊
原文外掛簡介
Disable CSS JS Cache is a powerful yet lightweight plugin that helps WordPress developers and site administrators manage browser caching for CSS and JavaScript files. This is particularly useful during development, testing, or when making frequent changes to your theme files.
Key Features
Disable CSS/JS Caching – Adds dynamic timestamps to CSS and JS files to prevent browser caching
Smart Cache Busting – Choose between timestamp-based or file modification time-based versioning
Performance Mode – Selectively cache-bust only CSS, only JS, or both
CDN Support – Option to apply cache busting to CDN-hosted files
Admin Bar Toggle – Quick enable/disable from WordPress admin bar
Statistics Dashboard – Track how many files are being cache-busted
Admin Notifications – Optional reminder when cache busting is active
Clear Cache Button – One-click to clear WordPress and compatible caching plugins
Browser Caching Control – Optionally enable browser caching for static assets (images, CSS, JS, PDF)
Configurable Cache Duration – Set custom cache duration for static assets (60 seconds to 1 year)
Automatic .htaccess Management – Automatically adds and removes caching rules from .htaccess
Exclude Paths – Exclude specific files or paths from cache busting
Development-Friendly – Perfect for development environments where you need to see changes immediately
Production-Ready – Enable browser caching for better performance on live sites
Clean Uninstall – Removes all settings and .htaccess rules when uninstalled
How It Works
When “Disable CSS JS Cache” is enabled, the plugin appends a current timestamp to all CSS and JavaScript file URLs on the frontend. This forces browsers to fetch fresh versions of these files instead of using cached versions.
The browser caching feature allows you to add caching headers to your .htaccess file for static assets, improving site performance by reducing server requests.
Use Cases
Development Environment – See CSS and JS changes immediately without clearing browser cache
Staging Sites – Test changes with confidence that you’re seeing the latest files
Production Sites – Control browser caching for optimal performance
Troubleshooting – Quickly determine if issues are cache-related
Settings
Access the plugin settings from Settings > Disable CSS JS Cache in your WordPress admin:
Enable Cache Busting – Turn cache busting on/off
Cache Busting Method – Choose Force Refresh (timestamp) or Smart Refresh (file modification time)
Performance Mode – Select Both CSS & JS, CSS Only, or JS Only
CDN Support – Enable cache busting for external/CDN files
Exclude Paths – Add files or paths to exclude from cache busting
Admin Bar Toggle – Show quick toggle in admin bar
Admin Notice – Display reminder when cache busting is active
Browser Caching – Enable/disable .htaccess caching rules
Caching Duration – Set how long browsers should cache static assets
Additional Information
Support
For support, feature requests, or bug reports, please visit the plugin support forum.
Contributing
This plugin is open source. Contributions are welcome!
Privacy
This plugin does not collect or store any personal data. It only stores plugin settings in your WordPress database.
Technical Details
Filters Available
style_loader_src – Modifies CSS file URLs
script_loader_src – Modifies JavaScript file URLs
Requirements
WordPress 5.0 or higher
PHP 7.0 or higher
Apache server with mod_headers enabled (for browser caching feature)
Writable .htaccess file (for browser caching feature)
File Structure
disable-css-js-cache.php – Main plugin file
includes/ – Core plugin classes
uninstall.php – Cleanup on uninstall
languages/ – Translation files
Compatibility
Compatible with all WordPress themes
Works with major page builders
Multisite compatible
Translation ready
