torchbox / careers

Torchbox careers site
https://torchbox.com/careers
4 stars 1 forks source link

Remove peopleHR file caching #104

Open Morsey187 opened 1 year ago

Morsey187 commented 1 year ago

Description of Changes Made

The PR removes code used to cache (read/write) PeopleHR requests into a folder, and instead calls the API directly for every request.

The current caching method used for PeopleHR is no longer supported (results in a read-only file error). We could fix this however, removing the file caching seems to be a better option, this type of file caching does not seem to be offically supported by Vecel/Next.js (ref) and will likely result in similar issues in the future (in terms of upgrades and changes to Vercel).

Removing the file caching will result in a few extra requests to peopleHR when job pages need to revalidate, however the changes we also reduce a lot of technical debt.

How to Test

Run Next.js in production, test Next.js's page caching works if peopleHR requests were to fail.

[Link to changes made on preview site]()

MR Checklist

Morsey187 commented 1 year ago

@jhancock532 I've found it difficult to follow the current setup for the serverless functions (peopleHR endpoint), so would be ideal if you could verify that removing this won't causes issues else where, i.e. it's not being relied on for something else.