Setting cache control and expires inside a module

Wandenberg Peixoto wandenberg at gmail.com
Fri Apr 27 00:53:55 UTC 2012


Hi Maxim,

thanks for your response.
I was hoping it had a specific function in the nginx core for that. I
looked the ngx_http_set_expires function before ask to the list,
but don't want to copy the code, if was possible to just call some function
will be better.
If don't have any other way, I will implement based on that code.

Regards,
Wandenberg

On Thu, Apr 26, 2012 at 11:33 AM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Thu, Apr 26, 2012 at 10:04:29AM -0300, Wandenberg Peixoto wrote:
>
> > Hi Brian,
> >
> > I need to this inside my module, it already exists.
> > Actually it responds to GET method and I need to add response to OPTIONS
> > methods to support cross domain access,
> > but want to send the response with cache headers, only for OPTIONS.
> > This is the reason I need to do that by code.
>
> I really wonder why you ever asked, I'm pretty sure you'll be able
> to write correct code yourself.  See ngx_http_set_expires() in
> ngx_http_headers_module.c for an example.
>
> Maxim Dounin
>
> >
> > Regards,
> > Wandenberg
> >
> > On Thu, Apr 26, 2012 at 8:19 AM, Brian Akins <brian at akins.org> wrote:
> >
> > >
> > > On Apr 25, 2012, at 12:15 AM, Wandenberg Peixoto wrote:
> > > > I need to add response to OPTIONS method to a module to allow cross
> > > domain access,
> > > > but I want to set cache control and expires headers, only for this
> > > method, to browsers does not ask this method frequently.
> > >
> > > I did this in a simple Lua script. Could do the same with perl.
> > >
> > > _______________________________________________
> > > nginx-devel mailing list
> > > nginx-devel at nginx.org
> > > http://mailman.nginx.org/mailman/listinfo/nginx-devel
> > >
>
> > _______________________________________________
> > nginx-devel mailing list
> > nginx-devel at nginx.org
> > http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20120426/348f8e9a/attachment.html>


More information about the nginx-devel mailing list