Problems while image in queue or if missing in cache
-
I think maybe the nginx call is incorrect in the instructions?
Assume you open a page with 30-40 images – all high resolution – and just before you empty the cache directory. Then loads of the images will not load!
In general there seem to be performance issues with this plugin. The images seem to not have any caching header set – even though I added webp and avif to the always cache settings.
As it is right now – the actual operation runs quite problematic before the cache is fully filled. The simply convert once loaded has some bugs – if the website already tries to serve those images before they are generated.
Below is my nginx.conf extract – and this really needs some improvements because right now it works badly:
# Add support for "WebP + AVIF converter" WordPress plugin # https://www.ads-software.com/plugins/fastware-webpavif/#installation location ~* wp\-content/(?!cache/fastware\-webpavif).+\.(jpe?g|png|gif|bmp|webp)$ { rewrite /wp\-content/(.+)$ /wp-content/cache/fastware-webpavif/$1; } location ~* cache/fastware\-webpavif.+\.(jpe?g|png|gif|bmp)$ { add_header Vary Accept; try_files $uri.pref$avif $uri.pref$webp $uri$avif $uri$webp $uri /?fw-webp-avif-ondemand=all; } location ~* cache/fastware\-webpavif.+\.webp$ { add_header Vary Accept; try_files $uri$png /?fw-webp-avif-ondemand=png; } root /var/www/openmtbmap.org/htdocs; index index.php index.html index.htm; # Caching the typical static files such as css, js, jpg, png and so forth # helps in telling the browser they can cache the content location ~* \.(ico|css|js|gif|jpe?g|png|webp|avif)$ { expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Strict-Transport-Security "max-age=63073000; includeSubDomains; preload" always; add_header X-Frame-Options SAMEORIGIN; add_header 'Referrer-Policy' 'strict-origin-when-cross-origin'; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; } # Cache static files location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp|avif)$ { add_header "Access-Control-Allow-Origin" "*"; add_header Strict-Transport-Security "max-age=63073000; includeSubDomains; preload" always; add_header X-Frame-Options SAMEORIGIN; add_header 'Referrer-Policy' 'strict-origin-when-cross-origin'; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; access_log off; log_not_found off; expires max; } #Media: images, icons, video, audio, HTC location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|webp|avif)$ { expires max; access_log off; add_header Pragma public; add_header Cache-Control "public"; add_header Strict-Transport-Security "max-age=63073000; includeSubDomains; preload" always; add_header X-Frame-Options SAMEORIGIN; add_header 'Referrer-Policy' 'strict-origin-when-cross-origin'; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options nosniff; access_log off; log_not_found off; } location / { set $serve_URL $fullurl${uri}index.html; try_files $serve_URL $uri $uri/ /index.php$is_args$args; #BASED ON https://nucuta.com/wp-fastest-cache-configuration-for-nginx/ } // and so on
- The topic ‘Problems while image in queue or if missing in cache’ is closed to new replies.