Jump to content

Nginx Image Caching


Recommended Posts

runtimesandbox
Posted

I've been experimenting with using Nginx cache for caching images like posters and backdrops on my reverse proxy. 

This has been working really well and the interface feels a whole lot more responsive / quicker to load (my images are stored with my media or HDDs)

The one issue I have is with backdrops - if i search for and download a new backdrop it won't show in the interface as the json that emby returns to say which images should be loaded is cached.

Here is my location match line from my nginx config - has anyone tried this before and has any suggestions?

    location ~* /emby/Items/.*/Images/(Primary|Backdrop|Logo|Art|Banner|Thumb|Disc|Chapter)|/ChapterImages/|\.bif$ {
        proxy_pass http://emby_backend;
		...

It looks like the json loads from this path `emby/Items/7614748/Images` and is being cached as well. 

 

GrimReaper
Posted
5 minutes ago, runtimesandbox said:

(my images are stored with my media or HDDs)

You could also enable library option to keep a cached copy of images in server's metadata folder, that should give you a speed bump (and not spin your HDDs while browsing). 

Posted
14 minutes ago, runtimesandbox said:

It looks like the json loads from this path `emby/Items/7614748/Images` and is being cached as well. 

 

Hi, being cached by who?

runtimesandbox
Posted
52 minutes ago, Luke said:

Hi, being cached by who?

cached by my nginx proxy cache using this cache configuration

location ~* /emby/Items/.*/Images/(Primary|Backdrop|Logo|Art|Banner|Thumb|Disc|Chapter)|/ChapterImages/|\.bif$

  • Thanks 1
runtimesandbox
Posted
1 hour ago, GrimReaper said:

You could also enable library option to keep a cached copy of images in server's metadata folder, that should give you a speed bump (and not spin your HDDs while browsing). 

yes i did use to use this option but wanted to try the nginx route as it can serve the images slightly quicker and better manages the storage the cache uses.

Posted

hopefully you are honoring http response cache-control headers and not caching something that indicates no-store

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...