Hello

I want use cache nginx and cache browser.

For managing cache nginx i use X-Accel-Expires.
For managing cache browser i use Cache-Control.

Cache-Control is simple, need set parameters http_cache in add_view and 
cache_max_age in add_static_view.

But how set X-Accel-Expires in same level?(as a parameter in add_view)

In my opinion such parameter does not exists or am I mistaken?
if so, how to pass this parameter to "tween"?
So I installed it there:

config.add_view(
        cache_view,
        route_name='cache_view',
        renderer='test_cache_nginx:templates/index.jinja2',
        http_cache=10,
       * x_accel_expires=100*,
    )

#tween:
def simple_tween_factory(handler, registry):

    def simple_tween(request):

        response = handler(request)
        #*x_accel_expires* = ... here i get parameter ... 

        if not *x_accel_expires*:
            x_accel_expires = 
registry.settings.get('cache.x_accel_expires', 0)
        response.headers.add('X-Accel-Expires', x_accel_expires)

        return response

    return simple_tween

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to