This PR settles on a caching strategy that best supports the introduction of asynchronous queries to populate detail pages. In short, it:
Separates caching concerns: Compiled JavaScript is cached on a per-view basis (closes #449). Meanwhile, API calls that generate display data are cached separately. That means we're foregoing and can close #447.
Increases max cache entries from 10k to 15k. There are about 8.9k entries in the production cache, i.e., we aren't using the full 10k allowance, but there are potentially two API views per employer that could be cached, so I increased the cache size, just in case.
Updates the JavaScript to grab the data year from the year select, enabling direct navigation to a specific year and defaulting to the most recent year if a data year parameter is not given.
For employer pages with data year parameters, adds a meta tag indicating that the URL without the parameter should be considered canonical.
Adds a site map of canonical employer URLs.
Adds a handy dandy spinner to the year toggle to indicate that data is loading. Think this really helps with user friendliness.
These changes will support navigating directly to a given data year in #456.
Testing instructions
Cruise around the staging site (https://bga-payroll.datamade.us) and confirm that things load sufficiently quickly and nothing seems broken.
Non-parameterized URL should show most recent year (no redirect)
~Forest is gonna look into strategies for caching~ We'll just pay the price for doing this, as the canonical URLs will make up a decreasing share of disk space over time
Parameterized URLs will point to non-parameterized URL as canonical
We will make a site map with the non-parameterized URLs
Description
This PR settles on a caching strategy that best supports the introduction of asynchronous queries to populate detail pages. In short, it:
These changes will support navigating directly to a given data year in #456.
Testing instructions