Welcome! Log In Create A New Profile

Advanced

Re: Writing a cache module

September 28, 2009 03:38PM
On Mon, Sep 28, 2009 at 03:06:25PM -0400, Akins, Brian wrote:

> I need to write cache module that's not upstream based. (Long story...)
>
> Reading through the upstream code and the proxy and fastcgi modules, it
> looks fairly simple.
>
> Just so I know I'm on the right track:
>
> - to get something from cache I should generate a key for r->cache, try to
> open file using ngx_http_file_cache_open, then "serve" it using
> ngx_http_cache_send (or replicate what it does).
>
> -to store something in cache, create a ngx_temp_file_t store my data in
> there, generate a key, then call ngx_http_file_cache_update to add that file
> to cache.
>
> Is that reasonable?

Yes.

> Any gotchas?

Do not forget ngx_http_file_cache_free() for noncacheable responses.


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

Writing a cache module

Akins, Brian September 28, 2009 03:10PM

Re: Writing a cache module

Igor Sysoev September 28, 2009 03:38PM

Re: Writing a cache module

Akins, Brian September 28, 2009 04:02PM

Re: Writing a cache module

cripy November 13, 2009 11:42AM

Re: Writing a cache module

Akins, Brian November 13, 2009 12:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 328
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready