Roulette Adventures
Forum Replies Created
-
Awesome job fixing the issue so quickly. Great support!
@mktk54 I think I read on the faq for this plugin that it does not work with CDNs. I could be wrong and the plugin author will correct me if I am.
@mateuszgbiorczyk Yes, the $do_not_cache, $skip_reason and $bypass are variables. $skip_reason is nothing more than a string used in response headers and isn’t required.
I originally (12 months ago) set up my servers loosely based on this tutorial; https://www.ryadel.com/en/nginx-reverse-proxy-cache-wordpress-apache-iis/
When those variables set to 0 the request is retrieved from cache, when set to 1 it is served by Apache.
It will only work for servers using Nginx as a reverse proxy. If they are using Nginx as their main http server then it would probably fail. I’m not an expert and really can’t offer a firm solution, but it worked for me.
Also, bypassing the cache to serve images defeats the purpose of a cache and impacts performance. For me this is a temporary workaround.
Hey there @mateuszgbiorczyk
Thanks for your help.
Not sure if this would apply to others or not. Perhaps it would if they have Nginx as a reverse proxy to an Apache back end.
My configuration is based on many examples of Nginx reverse proxy techniques. The major difference is all pages are served out of ram rather than on disk.
In case it is useful for others, below is the entire wordpress.conf which I include for my WordPress sites. Don’t take this as the perfect setup because it could do with improvement. It’s an ongoing thing.
# CACHE CONFIGURATION for WordPress # define nginx variables set $do_not_cache 0; set $skip_reason ""; set $bypass 0; # Don't cache URIs containing the following segments if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|sitemap(_index)?.xml|wp-cron") { set $do_not_cache 1; set $skip_reason URI; set $bypass 1; } # Don't cache people signing up if ($request_uri ~* "/join/|/wp-login.php?action=register|/wp-login.php?") { set $do_not_cache 1; set $skip_reason URI; set $bypass 1; } if ($request_method = POST) { set $do_not_cache 1; set $skip_reason "POST"; set $bypass 1; } # skip caching WordPress cookies if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wordpress_(?!test_cookie)|wp-postpass|wordpress_no_cache|wordpress_logged_in") { set $do_not_cache 1; set $skip_reason "Cookie Type"; set $bypass 1; } # Don't cache URIs for wordpress preview if ($request_uri ~* "preview=true") { set $do_not_cache 1; set $skip_reason "PREVIEW"; set $bypass 1; } # Don't cache Webp if ($request_uri ~* "/*.webp") { set $do_not_cache 1; set $skip_reason "WEBP"; set $bypass 1; } # CACHE CONFIGURATION for WordPress - ENDI have resolved the issue by adding the following;
# Don't cache Webp if ($request_uri ~* "/*.webp") { set $do_not_cache 1; set $skip_reason "WEBP"; set $bypass 1; }My Nginx and Apache were exactly as the FAQ suggested, including .htaccess.
I did need to make one minor change with the try_files within the server block.
try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404; became proxy_pass http://apache_backend;I have a few physical server boxes here. Nginx is machine with apache on another. Nginx is used only for caching apache.
The problem I have with bypassing the cache is the passing requests for images back to apache all the time rather than Nginx caching them. All sites are cached in a ram-drive. The apache machine processes php and other stuff and Nginx holds it all in memory. There is no disk activity at all when serving pages & images. So, bypassing caching for webp is a bit of a problem.
@mateuszgbiorczyk Sorry, I’ve been out of town. I will send a copy of my Nginx config when I get home later. Sorry to hold you up.
@deepvoice Sorry for not getting back to you. I’ve been out of town.
I modified /wp-content/plugins/webp-converter-for-media/app/Settings/Errors.php
Around line 79 I commented out the following;
} else if ($this->ifRedirectsAreCached() === true) { $errors[] = 'rewrites_cached'; }It now looks like this;
} /** else if ($this->ifRedirectsAreCached() === true) { $errors[] = 'rewrites_cached'; } **/I should point out that bypassing error checking is never a good idea and this is a temporary fix allowing you to regenerate.
@mateuszgbiorczyk Thanks for you reply and again I apologise if my previous reply wasn’t respectful at all.
I also bypassed the Nginx Reverse Proxy and went straight to Apache and the same issue continues. All .htaccess files are correct as far as I can tell.
I have temporarily resolved the issue by bypassing the code which throws this particular error. I’ve done this for all my sites.
The ‘Regenerate’ button is re-enabled and works perfectly. I have tested all sites with and without caching with no issues.
Given that this error message appears minor then perhaps an option to ignore it rather than if effectively being fatal. By fatal I mean we cannot regenerate.
I will email you directly in the next day or so.
Other than the issue I’m having I consider it to be an excellent plugin and it works as advertised. 🙂
Is there a valid reason why the “Regenerate” button is disabled when this error is shown. It seems when the error is bypassed regeneration works perfectly, the site works perfectly and all redirects work as expected.
Even with no form of caching the error continues. All http headers suggested everything is fresh with no-cache. Server response also says no-cache.
I’d be interested to know what error is being picked up that no other plugin or site, using wordpress, joomla, html, can detect.
I’m sorry if my attitude appears a little off but I’m trying to understand what the problem really is.
Thanks for you help.