Join the community today
Register Now

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 Well-Known Member

    2,533
    231
    63
    May 31, 2014
    Ratings:
    +394
    Local Time:
    7:41 PM
    Nginx-1.13.x
    MariaDB 10.1.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 Well-Known Member

    2,533
    231
    63
    May 31, 2014
    Ratings:
    +394
    Local Time:
    7:41 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    Anyone? :(
     
  3. eva2000

    eva2000 Administrator Staff Member

    29,034
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,784
    Local Time:
    2:41 AM
    Nginx 1.13.x
    MariaDB 5.5
    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 Well-Known Member

    2,533
    231
    63
    May 31, 2014
    Ratings:
    +394
    Local Time:
    7:41 PM
    Nginx-1.13.x
    MariaDB 10.1.x
    How?
     
  5. eva2000

    eva2000 Administrator Staff Member

    29,034
    6,589
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,784
    Local Time:
    2:41 AM
    Nginx 1.13.x
    MariaDB 5.5