Page MenuHomePhabricator

Improve the /media/math/check endpoint
Closed, ResolvedPublic

Description

Mathoid's /texvcinfo checks the input formula and normalises it. It is used by RESTBase's media/math/check endpoint for each incoming request in order to de-duplicate formulae. However, that introduces an extra request latency even when that is not needed. Instead of blindly sending all of the requests to Mathoid, RESTBase should:

  1. Check whether we have the request in POST storage already, and if so, short-circuit around the call to Mathoid
  2. Check if the request's formula is known to have a normalised form and if so use that version. This needs an additional key_value bucket that can store de-duplication indirection information
  3. If all of the above 404s, call Mathoid