Coupon Box NGINX cache configuration
-
My site is using NGINX’s built in cache.
However, if one customer signs up for the coupon, it does not pop up for anyone else.
It seems that this is because the cache is remembering that a user already signed up and therefore it does not show up again.
When I manually clear the entire cache, the pop up comes up again.
How does the plugin remember what someone did?
Here’s a similar nginx configuration, you can see
#Skip cache for POST, Query String, WP-*, Sitemap and logged in users
set $skip_cache 0;# POST requests and URLs with a query string should always go to PHP
if ($request_method = POST) {
set $skip_cache 1;
}if ($query_string != “”) {
set $skip_cache 1;
}# Don’t cache URIs containing the following segments
if ($request_uri ~* “/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml”) {
set $skip_cache 1;
}# Don’t use the cache for logged-in users or recent commenters
if ($http_cookie ~* “comment_author|wordpress_[a-f0-9]+|wp-postpass
|wordpress_no_cache|wordpress_logged_in”) {
set $skip_cache 1;
}# try as file then dir then passes to index.php with query string arg as parameter
# for permalinks
location / {
try_files $uri $uri/ /index.php?$args;
}location ~ \.php$ {
try_files $uri $uri/ /index.php =404;
add_header X-Cache-Status $upstream_cache_status;
include fastcgi.conf;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache wordpress;
fastcgi_cache_valid 1440m;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}location ~* \.(js|css|png|jpg|jpeg|gif|ico|eot|otf|ttf|woff|woff2)$ {
add_header Access-Control-Allow-Origin *;
add_header Cache-Control “public, max-age=31536000, immutable”;
access_log off; log_not_found off;
}The page I need help with: [log in to see the link]
- The topic ‘Coupon Box NGINX cache configuration’ is closed to new replies.