{"id":76811,"date":"2017-10-30T08:58:46","date_gmt":"2017-10-30T08:58:46","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/prevent-browser-caching\/"},"modified":"2024-04-09T17:18:12","modified_gmt":"2024-04-09T17:18:12","slug":"prevent-browser-caching","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/prevent-browser-caching\/","author":15605758,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"2.3.5","stable_tag":"2.3.5","tested":"6.5.8","requires":"4.0","requires_php":"","requires_plugins":null,"header_name":"Prevent Browser Caching","header_author":"Kostya Tereshchuk","header_description":"Automatic update the version of all JavaScript and CSS files each time you load a page.","assets_banners_color":"99a54c","last_updated":"2024-04-09 17:18:12","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/tutori.org\/donate\/","header_plugin_uri":"","header_author_uri":"https:\/\/tutori.org\/kostya\/","rating":4.9,"author_block_rating":0,"active_installs":10000,"downloads":110001,"num_ratings":28,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":{"1.1":{"tag":"1.1","author":"kostyatereshchuk","date":"2018-01-13 06:23:35"},"2.0":{"tag":"2.0","author":"kostyatereshchuk","date":"2018-01-13 06:23:35"},"2.1":{"tag":"2.1","author":"kostyatereshchuk","date":"2018-05-21 15:31:41"},"2.2":{"tag":"2.2","author":"kostyatereshchuk","date":"2018-07-04 15:42:51"},"2.3":{"tag":"2.3","author":"kostyatereshchuk","date":"2018-10-26 18:00:40"},"2.3.3":{"tag":"2.3.3","author":"kostyatereshchuk","date":"2022-06-01 08:56:34"},"2.3.4":{"tag":"2.3.4","author":"kostyatereshchuk","date":"2023-09-25 07:47:25"},"2.3.5":{"tag":"2.3.5","author":"kostyatereshchuk","date":"2024-04-09 17:18:12"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":1,"4":0,"5":27},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1793665,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":1793665,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":2686146,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.1","2.0","2.1","2.2","2.3","2.3.3","2.3.4","2.3.5"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":1878563,"resolution":"1","location":"assets","locale":""}},"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[7626,5757,13248,734,2250],"plugin_category":[59],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-76811","plugin","type-plugin","status-publish","hentry","plugin_tags-assets","plugin_tags-browser-cache","plugin_tags-clear","plugin_tags-development","plugin_tags-frontend","plugin_category-utilities-and-tools","plugin_committers-kostyatereshchuk"],"banners":{"banner":"https:\/\/ps.w.org\/prevent-browser-caching\/assets\/banner-772x250.png?rev=2686146","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/prevent-browser-caching\/assets\/icon-128x128.png?rev=1793665","icon_2x":"https:\/\/ps.w.org\/prevent-browser-caching\/assets\/icon-256x256.png?rev=1793665","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/prevent-browser-caching\/assets\/screenshot-1.png?rev=1878563","caption":""}],"raw_content":"<!--section=description-->\n<p>Are you a frontend developer? Do you want to clear browser cache for all users? Just activate this plugin and show your work!<\/p>\n\n<p>Prevent Browser Caching allows you to update the assets version of all CSS and JS files automatically or manually in one click.<\/p>\n\n<p>Now you can show the latest changes on the site without asking the client to clear the cache.<\/p>\n\n<h4>How it works?<\/h4>\n\n<p>Usually, WordPress loads assets using query param \"ver\" in the URL (e.g., style.css?ver=4.9.6). It allows browsers to cache these files until the parameter will not be updated.<\/p>\n\n<p>To prevent caching of CSS and JS files, this plugin adds a unique number (e.g., 1526905286) to the \"ver\" parameter (e.g., style.css?ver=4.9.6.1526905286) for all links, loaded using wp_enqueue_style and wp_enqueue_script functions.<\/p>\n\n<h4>For developers<\/h4>\n\n<p>By default, this plugin updates all assets files every time a user loads a page and adds options in the admin panel (Settings -&gt; Prevent Browser Caching) which allows you to configure updating of these files.<\/p>\n\n<p>But you can also set the version of CSS and JS files programmatically.<\/p>\n\n<p>Just insert this code in functions.php file of your theme and change the value of assets_version when you need to update assets:<\/p>\n\n<pre><code>prevent_browser_caching( array( \n    'assets_version' =&gt; '123' \n) );\n<\/code><\/pre>\n\n<!--section=installation-->\n<h4>From WordPress dashboard<\/h4>\n\n<ol>\n<li>Visit \"Plugins &gt; Add New\".<\/li>\n<li>Search for \"Prevent Browser Caching\".<\/li>\n<li>Install and activate Prevent Browser Caching plugin.<\/li>\n<\/ol>\n\n<h4>From WordPress.org site<\/h4>\n\n<ol>\n<li>Download Prevent Browser Caching plugin.<\/li>\n<li>Upload the \"prevent-browser-caching\" directory to your \"\/wp-content\/plugins\/\" directory.<\/li>\n<li>Activate Prevent Browser Caching on your Plugins page.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>2.3.5<\/h4>\n\n<ul>\n<li>Tested the plugin in WordPress 6.5.<\/li>\n<\/ul>\n\n<h4>2.3.4<\/h4>\n\n<ul>\n<li>Tested the plugin in WordPress 6.1.<\/li>\n<\/ul>\n\n<h4>2.3.3<\/h4>\n\n<ul>\n<li>Tested the plugin in WordPress 6.0.<\/li>\n<\/ul>\n\n<h4>2.3.2<\/h4>\n\n<ul>\n<li>Fixed \"Update CSS\/JS\" button in the admin bar.<\/li>\n<\/ul>\n\n<h4>2.3.1<\/h4>\n\n<ul>\n<li>Tested the plugin in WordPress 5.1.<\/li>\n<\/ul>\n\n<h4>2.3<\/h4>\n\n<ul>\n<li>Tested the plugin in WordPress 5.0-beta1 and optimized the code.<\/li>\n<\/ul>\n\n<h4>2.2<\/h4>\n\n<ul>\n<li>Added function \"prevent_browser_caching\" which disables all admin settings of this plugin and allows to set the new settings.<\/li>\n<li>Changing \"ver\" param instead of adding additional \"time\" param.<\/li>\n<\/ul>\n\n<h4>2.1<\/h4>\n\n<ul>\n<li>Added option to show \"Update CSS\/JS\" button on the toolbar.<\/li>\n<\/ul>\n\n<h4>2.0<\/h4>\n\n<ul>\n<li>Added setting page to the admin panel.<\/li>\n<li>Added automatically updating CSS and JS files every period for individual user<\/li>\n<li>Added manually updating CSS and JS files for all site visitors<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Added plugin text domain.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>First version of Prevent Browser Caching plugin.<\/li>\n<\/ul>","raw_excerpt":"Updates the assets version of all CSS and JS files. Shows the latest changes on the site without asking the client to clear browser cache.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/76811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=76811"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/kostyatereshchuk"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=76811"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=76811"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=76811"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=76811"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=76811"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=76811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}