Purge the Nginx cache

Kaushal Shriyan kaushalshriyan at gmail.com
Tue May 3 10:29:48 UTC 2022


Hi Francis,

I am following https://bluegrid.io/edu/how-to-purge-the-nginx-cache/ and
have attached the nginx config file for your reference. I am running nginx
version: nginx/1.20.2 on CentOS Linux release 7.9.2009 (Core)

#curl -I https://testnginxproxycachepurge.testintcraft.com -H 'Cache-Purge:
true'
HTTP/1.1 200 OK
Server: nginx/1.20.2
Date: Tue, 03 May 2022 10:24:24 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Cache-Control: max-age=21600, public
Link: <https://testnginxproxycachepurge.testintcraft.com/>;
rel="canonical", <https://testnginxproxycachepurge.testintcraft.com/>;
rel="shortlink", <https://testnginxproxycachepurge.testintcraft.com/home>;
rel="revision"
X-UA-Compatible: IE=edge
Content-language: en
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Permissions-Policy: interest-cohort=()
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary: Cookie
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains
Set-Cookie:
ADRUM_BT=R%3A0%7Cg%3A39ca00fc-b183-4fbf-95ad-494a6e7b8d1f99%7Cn%3Aicebergtest_e1c60ae6-5d00-47d5-8c0a-690d8465795f%7Ci%3A129601%7Cs%3Af%7Ch%3Ae;
expires=Tue, 03-May-2022 08:39:15 GMT; Max-Age=30; path=/
Last-Modified: Tue, 26 Apr 2022 11:42:25 GMT
ETag: "1650973345"
Access-Control-Allow-Origin: *
*X-Cache-Status: HIT*

Please guide me. Thanks in advance.

Best Regards,

Kaushal

On Tue, May 3, 2022 at 1:59 PM Francis Daly <francis at daoine.org> wrote:

> On Fri, Apr 29, 2022 at 12:54:42AM +0530, Kaushal Shriyan wrote:
>
> Hi there,
>
> > I am following
> >
> https://www.ryadel.com/en/nginx-purge-proxy-cache-delete-invalidate-linux-centos-7/
> > and https://bluegrid.io/edu/how-to-purge-the-nginx-cache/ to purge
> cache. I
> > am attaching the nginx file for your reference.
>
> It's probably best to follow exactly one document, to avoid any confusion
> from mixing things.
>
> I think that you are following the second one here with its method number
> 2, using the stock nginx proxy_cache_bypass directive.
>
> > $curl -I https://gsmanginxproxycachepurge.testapicraft.com -H
> > "secret-header: true"
>
> > *X-Cache-Status: HIT*
> >
> > I am seeing it as HIT instead of BYPASS and I am not sure about this term
> > between HIT vs MISS vs BYPASS vs EXPIRED in context to Nginx cache.
>
> Your configuration for https://gsmanginxproxycachepurge.testapicraft.com
> reads the $bypass variable if it is set; but it never sets it, so it will
> be read as "empty", and the proxy_cache_bypass directive will *not*
> cause the cache to be bypassed in this case.
>
> If you want to use this method, you must ensure that your $bypass variable
> is set for the one request that you are making.
>
> Good luck with it,
>
>         f
> --
> Francis Daly        francis at daoine.org
> _______________________________________________
> nginx mailing list -- nginx at nginx.org
> To unsubscribe send an email to nginx-leave at nginx.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20220503/e7c2fb30/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nginxdefault.conf
Type: application/octet-stream
Size: 5229 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20220503/e7c2fb30/attachment.obj>


More information about the nginx mailing list