-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cached statistics and all ontologies for ontologies tab and cleaned u… #700
base: dev
Are you sure you want to change the base?
Conversation
Hi @henrietteharmse ! I like the idea of caching all ontologies endpoints as it doesn't change during our application lifecycle. However, if I understand it correctly, the current implementation of the endpoint doesn't technically cache the result unless I'm missing something. The new controller will still go to solr to retrieve the ontologies every time it's called. I suggest we use Spring Cache which is straightforward to set up and can be helpful in our use case. Have a look at https://www.baeldung.com/spring-cache-tutorial |
The old endpoint is not caching it. I did look at the different Spring Cache solutions. However, we do not need all the functionality these solutions include and thus it is an overkill. |
That is not true. It only calls solr once and never again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
yup! i missed the variable bit here |
@@ -252,20 +252,14 @@ export const getOntologies = createAsyncThunk( | |||
export const getAllOntologies = createAsyncThunk( | |||
"ontologies_all", | |||
async (_, { rejectWithValue }) => { | |||
const path = `api/v2/ontologies?size=1`; | |||
const allOntologiesPath = `api/v2/cache/ontologies`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason we can't just make the cached endpoint the only endpoint instead of having a separate API route?
…p logging on backend.