Caching Infinite Scroll ajax requests
Would it be possible to make it configurable if you want to use GET instead of POST for Infinite Scroll AJAX requests ? This would make it possible for high traffic sites that use Varnish to cache these requests. I am aware that it was changed from GET to POST in 2014 because of issues with long request URLs. The default could still be POST though.
That's not on the roadmap at the moment, but we'd be happy to review a Pull Request for that idea!
Suggestion:
- Use GET by default, but check size of query parameters, and if they exceed a threshold, then use POST.
- Have a setting that allows PHP code to filter the method used (GET or POST) to force it one way or the other regardless of size.
- If the query fails, don't allow another query within N milliseconds
The lack of caching can really bring down high traffic sites, especially because there is no backoff of failures (https://github.com/Automattic/jetpack/blob/764a699120ca6795dac3d264207713516200ee7b/modules/infinite-scroll/infinity.js#L235-L241) so sites can DDOS themselves if requests start failing, creating a snowball of repeating requests.
This issue has been marked as stale. This happened because:
- It has been inactive in the past 6 months.
- It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.