当前位置: 动力学知识库 > 问答 > 编程问答 >

django - nginx / memcached caching of HTTP response -- can I cache the HTTP response headers in memcache or add them in nginx?

问题描述:

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?

分享给朋友:
您可能感兴趣的文章:
随机阅读: