Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

throttle page saving #5

Closed
2 tasks done
shokai opened this issue Apr 10, 2016 · 2 comments
Closed
2 tasks done

throttle page saving #5

shokai opened this issue Apr 10, 2016 · 2 comments

Comments

@shokai
Copy link
Owner

shokai commented Apr 10, 2016

  • client side
    • editorの編集が止まった時に"page:lines"をdispatchする
  • server side
    • clientからの送信が落ち着いたらPage#save()する
@shokai shokai changed the title pageの保存を遅らせる throttle page saving Apr 10, 2016
@shokai
Copy link
Owner Author

shokai commented Apr 19, 2016

clientからserverにはdiffを送っているけど、throttleするなら「サーバーが持っているであろうstateと現在のstateのdiff」を送らないとだめ
つまり単純なmiddleware内でのaction apply前後のdiffではだめということ

shokai added a commit that referenced this issue Apr 21, 2016
@shokai
Copy link
Owner Author

shokai commented Apr 21, 2016

server

pageをmemcachedにも保存するようにした。mongoへの書き込みは20秒落ち着いてから行われる。

Page#saveWithCache()Page.findByWikiTitle({wiki, title})を使う。

client

linesに変化がある時だけ送信されるようにmiddlewareを修正した

@shokai shokai closed this as completed Apr 21, 2016
shokai added a commit that referenced this issue Apr 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant