Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Is there any way to cache response headers along with the response body in Memcached for use with Nginx?

share|improve this question

migrated from stackoverflow.com Aug 28 '12 at 13:20

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

If you want cache responses in memcached you have to store your information in it manually by using something like a script. Nginx is not web accelerator like squid or varnish if you need that functionality out of the box take a look at varnish. It is working perfectly with nginx also.

share|improve this answer
    
Yes, I know it. I'm using Django as a backend and write the response to Memcached from there. But how can I cache response headers too? Because by default Nginx adds only it's own headers to response body read from Memcached. –  Dingo Aug 27 '12 at 7:20
    
It seems I got you but what exactly http headers are you talking about ? –  hostmaster Aug 27 '12 at 7:26
    
For a sample, I wish to control client caching, i.e. use such headers as "Expires", "Cache-Control", proper "Last-Modified" is also appreciated. Of course, with different values for different pages. –  Dingo Aug 27 '12 at 12:24
1  
I'm afraid you should use wiki.nginx.org/HttpHeadersModule instead OR use another memcached plugin github.com/bpaquet/ngx_http_enhanced_memcached_module –  hostmaster Aug 27 '12 at 12:53
    
I mean vanila ngx_http_memcached_module do not allow to store HTTP headers with data. For example, pages served by Nginx via Memcached storage have the default Nginx Content-Type. –  hostmaster Aug 27 '12 at 13:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.