Get the most out of your Centmin Mod LEMP stack
Become a Member

Nginx how to flush default cache?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Altair, Apr 4, 2020.

  1. Altair

    Altair Member

    68
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    2:05 PM
    hi,
    i have a static website hosted on linode with centmin mod with all defaults.

    however i updated some css and index.html files, the website still serves old version of css file even though i hard refreshed website, what command to use to flush nginx cache for static websites?


    searched some threads and there was only the /var method but there ain't any nginx folders there.
     
  2. eva2000

    eva2000 Administrator Staff Member

    50,459
    11,659
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,079
    Local Time:
    9:05 PM
    Nginx 1.25.x
    MariaDB 10.x
    Centmin Mod doesn't cache static files at Nginx level other than browser cache via cache control max-age/expires headers which are cleared on hard flush of browser cache. If you use Cloudflare in front of server, then you need to clear Cloudflare cache.

    I'd make sure you are updating the correct files on your server though. Outline on official Centmin Mod site as to where your files are located is at Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS

     
  3. Altair

    Altair Member

    68
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    2:05 PM
    I use cloudflare dns only, also I tried removing cookies from browser and using firefox browser, both report old css file, and I actually uploaded them (style.css) on the correct path home/nginx/domains/yourdomain.com/public via winSCP replacing old files.
     
  4. eva2000

    eva2000 Administrator Staff Member

    50,459
    11,659
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,079
    Local Time:
    9:05 PM
    Nginx 1.25.x
    MariaDB 10.x
    What is output for curl header check of your specific style.css
    Code (Text):
    curl -4I https://yourdomain.com/style.css

    For posting code or output from commands to keep the formatting, you might want to use CODE tags for code How to use forum BBCODE code tags :)