Page MenuHomePhabricator

Sort query parameters on urls
Closed, DuplicatePublic


Would it be possible to sort the query parameters on urls so that urls with params on different order would result to the same cache hits?

That way:

  • /video/48088296?title=0&byline=0&portrait=0&color=51a516
  • /video/48088296?byline=0&color=51a516&portrait=0&title=0

Would resolve to the same value.

Event Timeline

I'm out of my depths here, so sorry if it is a stupid question. I'm interested to understand why we're not doing this already.

The why is that there's an interest in sending more traffic to mediawiki apis from readers page views with things like related articles at the bottom of the article. Having to care about query param order when querying the api with smaxage can end up splitting the cache without noticing, so having consistent urls with query string sorting on the edge cache would make the clients more resilient and maybe reduce some caching duplicates.

I don't think this is an issue that we've noticed right now though.

I've cc'ed @dr0ptp4kt and @phuedx which were interested in the discussion too.