News:

SMF - Just Installed!

Main Menu

Plesk nginx caching doesn't cache pages with cookies

Started by Suhitha, Mar 07, 2026, 04:58 AM

Previous topic - Next topic

Suhitha

Question: Plesk nginx caching doesn't cache pages with cookies


Applicable to:

  • Plesk for Linux


Symptoms

Plesk pages with cookies aren't cached by nginx caching, with this in the page's headers: x-cache-status: BYPASS


Cause

nginx doesn't cache requests that have a Cookie HTTP header by default. Caching for pages that use cookies or user-specified parameters should be configured with great care, as improper setup can compromise website security or cause incorrect behavior in a web application. This feature is therefore disabled by default. The same principle applies to the default behavior of nginx, as outlined in its documentation.


Resolution

To change this behavior, configure the domain to cache pages with cookies in the nginx settings.

1.Log in to Plesk

2.Go to Domains > example.com > Apache & nginx

3.Enter the required cookies in the field Cache requests with cookies

For example, if _ga and _gid cookie names are set, nginx will only cache HTTP requests with cookie headers that contain _ga or _gid.