-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Overview
Currently, the search bar will template in ~10 lines of HTML for every subject code and discipline (source).
Problem
Looking at the page source, ~75% of the page size comes from such a massive template. The search bar is embedded on every single page, so a significant chunk of our response sizes come from just sending the search bar. Doing some conservative math, this ends up being ~20% of all our cloud costs.
Current solution
#1151 provides a quick solution for saving money by just removing the search bar entirely. While not the most optimal solution, it's more of a stopgap until a better one can be implemented.
Work needed
We need to redesign the search bar to avoid sending this much output. SIS only loads a list of course codes and builds up the HTML client side. This saves a bit on data, but such a solution might not be feasible in a Django app. Lou's list just doesn't include a list of subjects and has you provide a query instead.
My brainstormed solutions include:
- A separate search page or modal that only loads when requested by the user.
- Dynamically loading the course list upon request (either all at once or when the user enters a few characters).
- A Lou's list-esque simple search bar where users just enter text and we try to match it upon a server request.
- Template in the search bar from a separate HTTP request that is cached with a very long TTL (presumably course codes are not updated more than every ~3-4 months).