Want more timely Centmin Mod News Updates?
Become a Member

Nginx How can i exclude an image from Nginx cache?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Apr 29, 2016.

Tags:
  1. pamamolf

    pamamolf Premium Member Premium Member

    4,086
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    2:09 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Hi


    I have on the server an image that is created every x minutes dynamically on path:

    Code:
    /image/myimage.jpg
    How can i exclude only the current image from Nginx caching?

    Thank you
     
  2. pamamolf

    pamamolf Premium Member Premium Member

    4,086
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    2:09 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Anyone? :(
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,895
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    nginx doesn't caching anything out of the box even for centmin mod nginx. So if you have setup nginx caching mechanism, you'd have to exclude it depending on what you setup

    if you mean browser level caching via cache control headers, then just setup a location match for that image and set different cache control headers to exclude it from /usr/local/nginx/conf/staticfiles.conf include file's default image browser caching
     
  4. pamamolf

    pamamolf Premium Member Premium Member

    4,086
    428
    83
    May 31, 2014
    Ratings:
    +834
    Local Time:
    2:09 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    How?
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,895
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    10:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+