marcjulianschwarz / personio-raycast

A Raycast Extension for the HR-platform Personio
MIT License
0 stars 0 forks source link

low priority: cache tokens and other values for 24h #17

Closed marcjulianschwarz closed 5 months ago

marcjulianschwarz commented 5 months ago

Right now, the token is retrieved for every command interaction which takes time.

It would be better to cache the token for up to 24h (expiration time) and renew only when necessary.

Other values like the list of attendances (only retrieve new ones and store old ones) and employee numbers (update weekly) could also be cached.

marcjulianschwarz commented 5 months ago

Caching the token reduced the time to obtain it from around 200ms to 0.8ms.

marcjulianschwarz commented 5 months ago

Added a wrapper for the Cache class of Raycast to add expiration functionality for alle cache entries. That way we can make other values expire as well.

marcjulianschwarz commented 5 months ago

This wrapper could also be used to store the values for #2