问题描述:

I have a web server set up with nginx / memcached together as per the Module ngx_http_memcached_module instructions, with Django adding content to the cache and Nginx reading from it.

I'm trying to determine the correct way to handle HTTP headers. In particular I have some CORS headers that I'd like to add to the response from my Django code, but have a cached response. It seems like my options are either

  1. include the HTTP headers with the cached data and hope that

    nginx knows how to add its own HTTP headers into the

    mix

  2. only cache the web content, and then add all of the HTTP headers from nginx when there is a cache hit

Is there a recommended approach for this situation? Will option #1 work?

相关阅读:
Top