DavidAJohn / BookwormsLendingLibrary

Blazor Server client UI with a .NET Web API backend for an imaginary online library.
https://bookwormslibrary.azurewebsites.net
6 stars 4 forks source link

API caching #3

Open DavidAJohn opened 3 years ago

DavidAJohn commented 3 years ago

At the moment, there is no caching in the API.

It's not strictly necessary here, but would obviously be a useful feature for a site that became more popular.

DavidAJohn commented 3 years ago

I've added response caching to the API, but I've only enabled it specifically in the categories controller to cache the list of categories for 60 seconds.

Really, it's just there to cache a part of the page when a user moves through the pages of a book search, at the moment.

I'll just make sure it's not having any adverse effects before making use of it more extensively.

As I've discovered, anything that passes an authorisation header won't be cached for security reasons.