Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_cache_key and empty $content_type in cache

Maxim Dounin
April 29, 2011 09:34AM
Hello!

On Fri, Apr 29, 2011 at 06:22:39AM -0400, namesys wrote:

> Have a strange behavior of fastcgi cache, the variable $content_type
> does not passes to the cache KEY, configuration:

[...]

> But when I look into cache-file, the KEY field does not contain the
> content-type:
> .......
> KEY:
> |GET|?|site_name|/system/files/imagecache/50x50/iconimage.png|http://site_name/
> .......
> Content-Type: image/png
> .......
>
> As you see the content-type is visible in cache-file body, but it is not
> visible in the KEY field, it's just empty there. Does anybody knows why
> this happens?

Content-Type header you see in body is response content type
(available as $upstream_http_content_type variable). It can't be
used in cache key though as it's not known before we have a
response.

Variable $content_type is *request* content type. It's empty in
most cases as requests usually doesn't have any content.

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

fastcgi_cache_key and empty $content_type in cache

namesys April 29, 2011 06:22AM

Re: fastcgi_cache_key and empty $content_type in cache

Maxim Dounin April 29, 2011 09:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 251
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