Client-side Caching

Issue #22 resolved
Michael Johnson created an issue

To improve performance of the application and get it ready for production, client-side caching needs to be added. This is not the same as adding caching at the communicator level (Guzzle HTTP Caching). Rather, this is setting proper headers to allow for Symfony's AppCache to handle reverse proxying and caching output sent to users. Additionally, proper headers will be set so client consumers of the data will have caching hints applied, hopefully helping reduce both bandwidth and CPU consumption.

Comments (9)

  1. Michael Johnson reporter

    The Ruby API explicitly tries to cache the following endpoints:

    • /anime/id where the mine filter isn't set - 1 hour, public, must revalidate
    • /anime/search - 1 hour, public, must_revalidate
    • /manga/id where the mine filter isn't set - 1 hour, public, must revalidate
    • /manga/search - 1 hour, public, must_revalidate

    Makes sense, as user's lists are apt to change, along with personal details for anime and manga (mine=1). Additionally, we might want to cache user profile and friend data for a short time, 15-30 minutes.

  2. Ratan Dhawtal

    I think that 15 minutes will do. A user will be set offline after 10/15 minutes (I don't know the time exactly) inactivity on mal. 30 minutes will be to long, users will think that their friend is still online but he/she isn't.

    The profile can be 15/30/60 minutes because the stats aren't updating very fast on mal. You can choose in this case ;)

  3. Michael Johnson reporter

    Enable HTTP Cache

    Turn on the AppCache kernel in Symfony. This will allow the built-in reverse-proxy to cache data. Also, it’ll later let us use other cache solutions (Varnish, CloudFlare, etc.) should we wish.

    ref #22

    → <<cset 087fa9d87498>>

  4. Michael Johnson reporter

    Add Caching Support to Anime and Manga Details

    For anime and manga titles that don’t contain personal information, support caching the application output for up to one hour. This should help with stability and also bandwidth usage.

    ref #22

    → <<cset d56de16d0f6f>>

  5. Log in to comment