Make cache expiration in work and bookmark controllers configurable

Description

We want to use an ArchiveConfig variable where we set the cache expiration on the latest works page, the latest bookmarks page, and certain work indexes. We’ll initially set the value to 30 minutes.

It’s important to note that the caching only applies to those certain work indexes if they are un-updated. Posting, deleting, or adding a chapter to those indexes will expire the cache, so logged in users will see the pages updated fairly quickly. Due to full page caching, logged out users will not see updates for 40 minutes.

Because we are not touching the cache expiration code, we can only do limited testing of this.

How to test:

First, it is important to note the “Turn on caching (currently experimental)” admin setting is enabled.

For the latest works page:

  • Log in

  • Go to the latest works page at https://test.ao3.org/works to ensure it gets placed in the cache

  • Post a work

  • Refresh the latest works page and confirm the new work hasn’t appeared

  • Wait 30 minutes

  • Refresh the latest works page and confirm the new work has appeared

For the latest bookmarks page:

  • Log in

  • Go to the latest bookmarks page at https://test.ao3.org/bookmarks to ensure it gets placed in the cache

  • Bookmark a work

  • Refresh the latest bookmarks page and confirm the new bookmark hasn’t appeared

  • Wait 30 minutes

  • Refresh the latest bookmarks page and confirm the new work has appeared

For the work indexes:

 

Environment

None

Status

Assignee

james_

Reporter

james_

Roadmap

Bookmarks
Works

Priority

Medium

Affects versions

Fix versions

Components

Caching

Difficulty

Medium

Required Access Level

None

Milestone

Internal 0.9
Configure