Your setting to `add_view` is currently being dropped. It's not valid
to pass arbitrary things to `add_view`. A good way would be to mutate
the response via a decorator, adding the header in yourself. No need
for a tween.
def x_accel_expires(max_age):
def decorator(view):
def wrapper(context, request):
response = view(context, request)
response.headers.add('X-Accel-Expires', max_age)
return response
return wrapper
return decorator
config.add_view(
cache_view,
route_name='cache_view',
renderer='test_cache_nginx:templates/index.jinja2',
http_cache=10,
decorator=x_accel_expires(100)
)
> --
> 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-discus...@googlegroups.com.
> To post to this group, send email to
pylons-...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/pylons-discuss.
> For more options, visit
https://groups.google.com/d/optout.