Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-12788

Cache database search results for 1min

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Search
    • None

      Direct database search is still available as a fallback for when the indexed search is either unavailable or outdated (as in the search index doesn’t have the result at all or has an outdated result for some reason, which happens occasionally). While indexed search is able to handle a lot of requests, the direct database search is not. When a link to the direct database search is shared among Mastodon and queried hundreds of time, it results into hundreds of heavy queries to the database, making the whole website temporarily unavailable.

      The proposed solution is to cache the results for 1min. It matches the statement timeout. It shouldn’t be a problem for users as they have to select it manually, unless they followed a link in which case the same results are expected anyway.

      It should probably be renamed “cached” instead of “direct” or added in parallel in the code if we want to keep “direct” for editing forms.

            yvanzo yvanzo
            yvanzo yvanzo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Version Package