`
nathan.wu
  • 浏览: 47033 次
  • 性别: Icon_minigender_1
  • 来自: 南京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

the drawback of rails action cache

阅读更多
rails action cache can help performance a lot

but there is a drawback with action cache, it just can output text/html header content-type, eg: can not output text/xml header content-type for your blog rss feed.

I think there may need a hacker with reverse proxy server like nginx.

the config will like below, from now on nginx just support add_header syntax which means nginx will add user custom header to app server response header without check if the header already exist

location /rss {
    set_header content_type text/xml;
    proxy_pass http://app_server;
    break;
}

the set_header will check the output header parameter if exist replace it with user custom. if not just add to the header

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics