Page MenuHomePhabricator

Reduce TTL for the feed end point to 10 minutes
Closed, ResolvedPublic


The feed end point cannot be cleared by normal events as it is an aggregate of several items with many pages.

While it is possible to architect it in a way to achieve this, in reality it is much easier to just expire the feed more frequently to catch any updates. This is the current strategy.

Currently the TTL is 1 hour. This means that vandalism could persist for up to an hour in the feed *after it is fixed*. This is quite a long time.

In order to ensure vandalism is removed timely, we want to lower the TTL to something more frequent. 10 minutes seems like a reasonable time. Is this something that is possible technically without burdening the servers too much?

Event Timeline

Note this was discussed during the investigation of this ticket: T174993: Vandalism in "In the news" articles persisting in the app ?

While this isn't the cause of the vandalism persisting, it was noted that the 1 hour delay seems long regardless so this separate ticket was created to address that concern.

We already set the cache-control to 10 minutes, but currently we also cache in Cassandra the result for the current day. I want to completely remove current day cassandra caching from the endpoint - it makes sense for previous days because we can't really regenerate all the feed content for an arbitrary day (news for example are not accessible for an arbitrary day). This will have a very limited effect on performance, because the majority of time is spent on response hydration, so with Cassandra caching the average response time on RESTBase level is 300 ms and without it's 600ms. However on the client this will be completely unnoticeable since the Varnish cache hit ration is fairly good right now. Will submit a patch soon.

@Pchelolo awesome, thanks for the looking into it!

@Pchelolo also there is a related ticket for iOS to be able to respect this, but I think we aren't looking at the right headers:

T175329: Update app to recheck feed more often to prevent vandalism from being retained

Pchelolo claimed this task.

PR merged, to be deployed on Monday, so resolving.

Stashbot added a subscriber: Stashbot.

Mentioned in SAL (#wikimedia-operations) [2017-09-25T08:26:38Z] <mobrovac@tin> Started deploy [restbase/deploy@ab24f70]: Switch mobile-sections to next-gen storage and stop storing the current-day feed in Cassandra - T169940 T176233

Mentioned in SAL (#wikimedia-operations) [2017-09-25T08:36:41Z] <mobrovac@tin> Finished deploy [restbase/deploy@ab24f70]: Switch mobile-sections to next-gen storage and stop storing the current-day feed in Cassandra - T169940 T176233 (duration: 10m 03s)