You changed the CSS, the logo or a script, and you see the new one but visitors keep seeing the old version. The cause is their browser’s cache: the file was stored with the instruction “keep this for a while”, and until that time runs out the browser does not even ask the server whether it changed. The cure is not to ask visitors to press Ctrl+F5. It is to give the new file a new address.
First: confirm this is it
| 1 |
Open the site in a private window. If the new one shows there and the old one in your normal window, it is browser cache.
|
|
| 2 |
In the normal window, reload with Ctrl+Shift+R (it ignores the cache). If the new one appears, it is cache again.
|
|
| 3 |
To see how long the file is kept: F12, Network tab, click the file and read cache-control or expires in the response headers.
|
|
The cure: change the address when the file changes
| Way |
Example |
Note |
| Change the file name |
logo-2026.png instead of logo.png |
The safest. Works for images and fonts. Remember to update the page that calls it. |
| Add a version number |
style.css?v=7 |
WordPress does this by itself with the ?ver= of well-written themes and plugins. Some caching services ignore what follows the question mark. |
| Fingerprinted name |
style.3f9a1c.css |
Produced by build tools. The name changes whenever the content does. |
If your cache durations are very long and names carry a version or a fingerprint, you can tell the browser the file never changes with Cache-Control: public, max-age=..., immutable. Only do it when the name really changes with the content. To choose durations, see browser caching with .htaccess.
On WordPress
| 1 |
If it was the theme’s CSS that changed: the theme should bump its version number when it updates. If you edited the file by hand, change the number, or add a version where the file is loaded.
|
|
| 3 |
If you swapped the logo or an image, upload it under another name instead of replacing the old one. Replacing the file in the media library under the same name is what leaves the old one stuck in browsers.
|
|
|
The page itself (HTML) should not have a long browser cache. It is what points to the files with new names. If the page is stored for a long time, visitors will never learn that the name changed. The site cache and the browser cache are different things.
|
|
Anyone who already has the old file stored is only freed when the time runs out. For a serious defect already live, the only shortcut is to put the new file under another name and change the page. Plan for this before setting very long durations.
|
|
Changed the file and some visitors still see the old one? Send us the file’s address and what the cache-control header says.
Open a support ticket
|
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon) See plans |