{"action":"created","issue":{"url":"https://api.github.com/repos/xpressengine/xe-core/issues/1598","labels_url":"https://api.github.com/repos/xpressengine/xe-core/issues/1598/labels{/name}","comments_url":"https://api.github.com/repos/xpressengine/xe-core/issues/1598/comments","events_url":"https://api.github.com/repos/xpressengine/xe-core/issues/1598/events","html_url":"https://github.com/xpressengine/xe-core/pull/1598","id":93674197,"number":1598,"title":"캐시서버를 위한 Cache-Control 헤더 제어","user":{"login":"wkpark","id":232347,"avatar_url":"https://avatars.githubusercontent.com/u/232347?v=3","gravatar_id":"","url":"https://api.github.com/users/wkpark","html_url":"https://github.com/wkpark","followers_url":"https://api.github.com/users/wkpark/followers","following_url":"https://api.github.com/users/wkpark/following{/other_user}","gists_url":"https://api.github.com/users/wkpark/gists{/gist_id}","starred_url":"https://api.github.com/users/wkpark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wkpark/subscriptions","organizations_url":"https://api.github.com/users/wkpark/orgs","repos_url":"https://api.github.com/users/wkpark/repos","events_url":"https://api.github.com/users/wkpark/events{/privacy}","received_events_url":"https://api.github.com/users/wkpark/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-08T02:18:34Z","updated_at":"2015-07-08T04:37:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xpressengine/xe-core/pulls/1598","html_url":"https://github.com/xpressengine/xe-core/pull/1598","diff_url":"https://github.com/xpressengine/xe-core/pull/1598.diff","patch_url":"https://github.com/xpressengine/xe-core/pull/1598.patch"},"body":"* 캐시 친화적인 `Cache-Control` 헤더\r\n* 로그인사용자는 `cache-control: private`, 그 이외에는 `public`을 사용\r\n* `session_start()`를 로그인 할 경우에만 사용하여 `set-cookie` 사용 최소화\r\n\r\n모니위키에서 varnish 캐시서버 지원을 넣었던 경험을 바탕으로 일단 XE에서 최소한의 변경을 가해봤습니다.\r\n\r\n모니위키의 경우에 vanish 캐시서버 - 아파치 상태에서 `ab -n 1000 -c 3`을 평균적인 크기의 페이지에 대해 테스트해보면 15000~20000 RPS나 나옵니다. (varnish 캐시 없이는 150~300 RPS)\r\n\r\n반면 XE의 경우에는 `Set-Cookie`등의 요인을 제거하면 (이 패치 및 set-cookie 패치)\r\n`ngnix` 웹서버상에서 80 RPS 정도가 나오며, varnish 캐시서버를 쓰면 5000RPS~15000RPS가 나옵니다.\r\n\r\nnginx\r\n==\r\n~~~\r\n$ ab -n 500 -c 3 http://localhost:8000/ (nginx)\r\nRequests per second:    82.90 [#/sec] (mean)\r\nTime per request:       36.187 [ms] (mean)\r\nTime per request:       12.062 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          2706.19 [Kbytes/sec] received\r\n...\r\n~~~\r\nvarnish + nginx\r\n==\r\n~~~\r\n$ ab -n 500 -c 3 http://localhost/\r\n...\r\nRequests per second:    6797.36 [#/sec] (mean)\r\nTime per request:       0.441 [ms] (mean)\r\nTime per request:       0.147 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          222706.38 [Kbytes/sec] received\r\n...\r\n\r\n$ ab -n 5000 -c 100 http://localhost/\r\nRequests per second:    13301.13 [#/sec] (mean)\r\nTime per request:       7.518 [ms] (mean)\r\nTime per request:       0.075 [ms] (mean, across all concurrent requests)\r\nTransfer rate:          435806.75 [Kbytes/sec] received\r\n...\r\n~~~"},"comment":{"url":"https://api.github.com/repos/xpressengine/xe-core/issues/comments/119428583","html_url":"https://github.com/xpressengine/xe-core/pull/1598#issuecomment-119428583","issue_url":"https://api.github.com/repos/xpressengine/xe-core/issues/1598","id":119428583,"user":{"login":"misol","id":3437916,"avatar_url":"https://avatars.githubusercontent.com/u/3437916?v=3","gravatar_id":"","url":"https://api.github.com/users/misol","html_url":"https://github.com/misol","followers_url":"https://api.github.com/users/misol/followers","following_url":"https://api.github.com/users/misol/following{/other_user}","gists_url":"https://api.github.com/users/misol/gists{/gist_id}","starred_url":"https://api.github.com/users/misol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/misol/subscriptions","organizations_url":"https://api.github.com/users/misol/orgs","repos_url":"https://api.github.com/users/misol/repos","events_url":"https://api.github.com/users/misol/events{/privacy}","received_events_url":"https://api.github.com/users/misol/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T04:37:44Z","updated_at":"2015-07-08T04:37:44Z","body":"세션을 로그인에만 사용하는 것은 아닌데.. session_start를 doLogin 에만 사용하는 것은 무리수 아닌지요.."}}