Welcome! Log In Create A New Profile

Advanced

Re: Nginx cache files by mime type using ngx_srcache module

agentzh
June 18, 2013 10:24AM
Hello!

On Wed, Jun 12, 2013 at 3:51 AM, n1xman wrote:
> However, I have noticed every srcache_fetch GET /memc subrequest hits the
> memcached even though srcache_store skipped content-type which is not
> defined.
>

The cache fetch operation must be performed *before* sending a request
to the backend while the Content-Type response header is only
available *after* the backend request is already sent. You're having a
chicken and egg problem here. And I don't see how the srcache_fetch
can be skipped without a Content-Type response header available for
checks.

> This will keep busy the memcached server and I think srcache_fetch GET
> subrequest should not executed if srcache_store_skip triggered first.

Are you sure?

srcache_store_skip always runs after srcache_fetch for a particular
request. The caching workflow looks like this:

srcache_fetch
send backend request if it's a cache miss
receive backend response (headers)
srcache_store

I cannot see how srcache_store_skip can be triggered before
srcache_fetch without sending a backend request to get the
Content-Type response header.

Best regards,
-agentzh

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

Nginx cache files by mime type using ngx_srcache module

n1xman June 11, 2013 05:10AM

Re: Nginx cache files by mime type using ngx_srcache module

agentzh June 11, 2013 03:06PM

Re: Nginx cache files by mime type using ngx_srcache module

n1xman June 12, 2013 06:51AM

Re: Nginx cache files by mime type using ngx_srcache module

agentzh June 18, 2013 10:24AM

Re: Nginx cache files by mime type using ngx_srcache module

n1xman June 18, 2013 11:37AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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