-
Notifications
You must be signed in to change notification settings - Fork 38
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
[Datahub] Allow disabled ogc-client cache per request #1147
base: main
Are you sure you want to change the base?
Conversation
Affected libs: Affected apps:
|
593c2db
to
3a8e928
Compare
📷 Screenshots are here! |
📷 Screenshots are here! |
📷 Screenshots are here! |
bde5360
to
6da7bb0
Compare
6da7bb0
to
fda5a34
Compare
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.
Thanks for the changes! It looks good, just one suggestion but feel free to merge if you prefer to keep as is :)
url, | ||
options.wfsFeatureType, | ||
cacheActive | ||
) | ||
break | ||
} | ||
reader.load() |
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.
How about passing the cache param to load
directly, instead of adding another Reader on top of the others (with base-cache
) ? I find that the Readers are already hard to read...
I did it in my PR and it worked too : https://github.com/geonetwork/geonetwork-ui/pull/1149/files#diff-b68b461107422b0097c7a45b98e85da1f4fbbf2959a80521e3781ceeea07cb58
But that's just a suggestion, your way works fine too :)
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.
This was to avoid changing functions signature. Ok I will simplify and add cache param like you suggest.
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.
Ah I remember why I did this, it is because also i didn't want to pass the activeCache params through all the sub component, cause now i need to pass activeCache
to data-view > table-view > data-table, whereas if the cacheActive option is in the Reader I would not need all this modifications. What do you think? maybe we can ask a third opinion? Which one is best:
- let all the components and sub components to decide whether to cache or not (and then, we should add
@Input activeCache
to each components/child), simpler, but need edit everywhere when a request is done - or let the reader handle this one, less modifications, but sub components won't be allowed to deactivate cache (can only be done in parent that creates the reader), or well they can, but this would need to set the activeCache of the reader before requesting data.
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.
Mmmh okay, explained like that your way makes actually more sense than mine! I think that no matter which component (data/table etc), the link will always have the same update frequency anyway, so it will be cached in all cases --> and that's what this ticket is all about.
03b3324
to
0513459
Compare
Description
This PR allows disabling the ogc cache per request.
How to tests
This PR is a preparation work for the next PR where components will disable/enable cache according to dataset's update frequency when fetching data (eg. table and chart). So no manual testing.
Architectural changes
A new BaseCacheReader has been introduced from which all other readers (Wfs, Csv, Gml, Geojson, Excel) inherits the
cacheActive
private property.Screenshots
No UI
Quality Assurance Checklist
breaking change
labelbackport <release branch>
label