bpaquet / ngx_http_enhanced_memcached_module

Use memcached to perform caching in nginx, with lot of advanced features
213 stars 42 forks source link

Serving images, how to? #9

Open AtmanActive opened 9 years ago

AtmanActive commented 9 years ago

Hi,

First, kudos for coding this module and thanks for sharing.

Now, following your instructions carefully, I'm a bit confused how would one go for serving images from memcached via your module.

Since the data in the memcache key store needs to look like this:

EXTRACT_HEADERS\r\n
Content-Type: image/png\r\n
Cache-Control:max-age=21600\r\n
\r\n
NOW WHAT?

The thing that I don't understand here is how would one encode binary image data right below the header's textual data.

Thanks.

bpaquet commented 9 years ago

No encoding, just put the binary data after the second \r\n, like in http protocol.

On Thu, Jan 15, 2015 at 6:46 PM, AtmanActive notifications@github.com wrote:

Hi,

First, kudos for coding this module and thanks for sharing.

Now, following your instructions carefully, I'm a bit confused how would one go for serving images from memcached via your module.

Since the data in the memcache key store needs to look like this:

EXTRACT_HEADERS\r\n Content-Type: image/png\r\n Cache-Control:max-age=21600\r\n \r\n NOW WHAT?

The thing that I don't understand here is how would one encode binary image data right below the header's textual data.

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/bpaquet/ngx_http_enhanced_memcached_module/issues/9.