Welcome! Log In Create A New Profile

Advanced

Custom Cache Key

Posted by jayc89 
Custom Cache Key
May 25, 2012 04:07PM
I'm trying to cache the same page twice based on the content-type within the HTTP header.

We have a number of pages which can be requested as XML or JSON. As it stands NginX only caches the first request and serves all other request using the cached version whether XML or JSON is requested.

We have tried setting the proxy_cache_key to;
proxy_cache_key "$scheme$proxy_host$request_uri$upstream_http_content_type";

However I assume that $upstream_http_content_type is not a suitable variable here, nor did $http_accept work.

Can anyone recommend a work around?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 323
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready