'Delete cache Wordpress

I have a WordPress website, I work to it on local (some CSS fix), but when I deploy it to real server, changes aren't display. If I visit website in private navigation, no problem. But without private mode, the old css is called.

How can I force to refresh the cache browser for user and use the news css file ? I try WP Fastest Cache and some other, but they don't work.

(Sorry for my english)



Solution 1:[1]

we have 3 type of cache:

  1. browser cache
  2. server cache
  3. site cache

cache plugins can clear server and site cache but they can't clear browser cache directly. only browser can manage browser cache.

the only way to clear browser cache for all users is versioning or renaming the static files that browsers cache them before.

take a look at wp_enqueue_script and wp_enqueue_style documents . they have a version parameter. you can change the version each time you did a change to the file and browsers will get the new version for all users.

Solution 2:[2]

WP Fastest Cache plugin dashboard navigation menu option WPFC delete cache and Ctrl+F5 Screenshot dashboard

Solution 3:[3]

You need add version for file like

filename.css?v=12
filename.js?v=12

or generate version from php

$ver = microtime(1);
wp_enqueue_style('stylename', asset_path('styles/style.css'), false, $ver);
wp_enqueue_script('scriptname', asset_path('scripts/main.js'), ['jquery'], $ver, true);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Tarang koradiya
Solution 3 Maksim Gerasimenko