stumash / CoursePlanner

http://conucourseplanner.online
MIT License
5 stars 3 forks source link

Convert cacheable API requests from POST to GET #153

Closed Davidster closed 5 years ago

Davidster commented 6 years ago

Currently, our courseinfo, filtercoursecodes, and recommendedsequence API endpoints are using POST. These requests respond with the same JSON object each time they are called with equivalent body params, and they don't produce any side effects on the backend since they only do reads on the db. This means that we can safely benefit from http caching . This would be an easy change and result in a faster frontend and a reduced load on the server every time a request is repeated by the same client.

As such, these three endpoints should be changed to use GET instead of POST, and more importantly the backend should send the appropriate headers to allow caching. This will require code changes on the frontend and backend.

PeterGhimself commented 5 years ago

Started work on branch convertPostToGet-153