der*_*ert 5 perl caching catalyst http-headers
似乎默认情况下Catalyst不输出Cache-Control:
等标题.我知道我可以在给定的控制器方法中输出它们,如下所示:
$c->response->headers->last_modified(time);
$c->response->headers->expires(time + $self->{cache_time});
$c->response->headers->header(cache_control => "public, max-age=$self->{cache_time}");
Run Code Online (Sandbox Code Playgroud)
不过,在每种方法中做到这一点都会非常痛苦!我更喜欢的是:
有没有一个很好的方法来实现这一目标?
归档时间: |
|
查看次数: |
2904 次 |
最近记录: |