skip to Main Content

I have a WordPress site on a self-hosted domain. There is no cache plugins. I am using Firefox.

When I make changes to the CSS it can sometimes take hours for anything to change in the browser.

I use Plesk and its the same in the Plesk preview so the trick with a random hash and query doesn’t work either.

How to solve this please? I need to see live changes please.

4

Answers


  1. The way I get around this is to add a version to the css file that’s the time it has been changed last:

    <link rel="stylesheet" href="path/style.css?v=<?php echo filemtime("path/style.css"); ?>" type="text/css" />
    

    EDIT: Alternatively you could use a plugin that ultimately does the same thing: https://wordpress.org/plugins/stylecss-load-last-version/

    Note: these are solutions that will always load the most recent css file for all. If you only want to test, use the solution of @user3085741 (refresh the page).

    Login or Signup to reply.
  2. try use Ctrl + F5 to hard refresh your browser

    Login or Signup to reply.
  3. You can do is press ctrl + f5 or ctrl + shift + r. You can also use “Work Offline” mode if your using Firefox.

    Login or Signup to reply.
  4. Another alternative when you are doing development would be to turn off caching in Firefox altogether:
    “Hamburger menu”->Preferences->Advanced->Network. Check the box that says “Override cache management” and limit the cache to 0 MB.

    This way no pages will be cached in Firefox until you decide to turn caching back on (just uncheck the override box you checked above).

    This won’t help if something else is doing the caching, like a proxy or the server itself.

    Hope this is helpful.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search