DistributedProofreaders / dproofreaders

Distributed Proofreaders is a web application intended to ease the process of converting public domain books into e-texts.
https://www.pgdp.net
GNU General Public License v2.0
46 stars 28 forks source link

Decrease list_etexts.php overhead #1245

Closed cpeel closed 4 days ago

cpeel commented 5 days ago

list_etexts.php is one of the few public pages (does not require login to access) and its worth trying to decrease the system overhead for it. This PR does the following:

  1. optimizes the SQL used to generate the page by:
    • removing 1 of the 2 queries and using a 1-hour cached value for total number of projects per star metal
    • simplifying the query for the silver and bronze stars
  2. removing the sorting options on the page -- this reduces the links crawlers can hit that just generate more load and removes a feature that I don't think is really all that useful to humans.

While we're here increase the default page size to 50 from 20. This is likely more useful to users without changing the impact to the query.

Sandbox: https://www.pgdp.org/~cpeel/c.branch/decrease-list_etexts-overhead/list_etexts.php?x=g&sort=5

cpeel commented 5 days ago

Tagging @lhamilton1 for her review and agreement on removing the sorting feature of this page.