bpking1 / embyExternalUrl

some emby/jellyfin scripts
MIT License
687 stars 123 forks source link

请问下如何彻底关闭图片缓存 #226

Closed NickLuo21 closed 3 months ago

NickLuo21 commented 3 months ago

因为图片在本地,然后emby更新图片后,nginx里的缓存还没更新,不想再在nginx里走缓存了,请问下大佬怎么关闭nginx的图片缓存

chen3861229 commented 3 months ago

emby2Alist\nginx\conf.d\emby.conf 中把这段注释掉就行了

# Cache the images
    # location ~ /Items/(.*)/Images {
    #     set $tmp_proxy_cache_key $uri;
    #     set $tmp_remove_args false;
    #     if ($imageCachePolicy = 1) {
    #         set $tmp_proxy_cache_key $request_uri;
    #     }

    #     set $tmp_args &${args};
    #     if ($tmp_args ~* ^(.*)(&maxHeight=\w*)(.*)$) {
    #         set $tmp_args $1$3;
    #     }
    #     if ($tmp_args ~* ^(.*)(&maxWidth=\w*)(.*)$) {
    #         set $tmp_args $1$3;
    #     }
    #     if ($tmp_args ~* ^(.*)(&quality=\w*)(.*)$) {
    #         set $tmp_args $1$3;
    #     }
    #     if ($tmp_args ~* ^&(.*)$) {
    #         set $tmp_args $1;
    #     }
    #     if ($imageCachePolicy = 2) {
    #       set $args $tmp_args;
    #       set $tmp_remove_args true; # for debug
    #     }
    #     # this need compile proxy_cache_purge module
    #     # if ($uri ~* ^(.*)/Primary/Delete$) {
    #     #     set $tmp_proxy_cache_key $1/Primary;
    #     #     set $purge_method 1;
    #     # }
    #     proxy_pass $emby;

    #     proxy_cache emby_images;
    #     proxy_cache_revalidate on;
    #     proxy_cache_lock_timeout 10s;
    #     proxy_cache_lock on;
    #     proxy_cache_valid 200 30d;
    #     proxy_cache_key $tmp_proxy_cache_key;
    #     proxy_cache_bypass $arg_nocache; # self access url args add nocache=1
    #     add_header X-Cache-Key $tmp_proxy_cache_key; # for debug
    #     add_header X-Remove-Args $tmp_remove_args; # for debug
    #     add_header X-Modifly-Args $args; # for debug
    #     add_header X-Cache-Status $upstream_cache_status; # This is only to check if cache is working
    #     # this need compile proxy_cache_purge module
    #     # proxy_cache_purge $purge_method;
    #     # add_header X-Cache-Purge $purge_method; # for debug
    # }
NickLuo21 commented 3 months ago

按照这个注释掉之后,新的用户和客户端是没问题了;老的用户和客户端还是加载的老的图片,是不是在其它地方还有针对用户和客户端的缓存?

chen3861229 commented 3 months ago

没有了,另外一个是字幕的缓存,和这个无关,浏览器和客户端 APP 自身也是有缓存在设备上的,浏览器清空缓存,安卓 APP 清空全部数据,其他客户端只能重装了

NickLuo21 commented 3 months ago

好的,多谢大佬指点