jsdelivr / globalping-cli

A simple CLI tool to run networking commands remotely from hundreds of globally distributed servers
Mozilla Public License 2.0
118 stars 14 forks source link

misc: improve client caching #118

Closed radulucut closed 1 month ago

radulucut commented 1 month ago

This allows for safely getting and setting cached responses in memory from the client. Also, it adds a cleanup function and a goroutine that will periodically remove the expired cached responses to free up the memory for long running commands.

MartinKolarik commented 1 month ago

Can you please briefly explain how this changes the caching behavior?

radulucut commented 1 month ago

I've updated the description. Let me know if you have any questions. Thanks.

MartinKolarik commented 1 month ago

We were caching the responses before as well, so if I understand this correctly, the main change is the cleanup after 30 seconds?

radulucut commented 1 month ago

yes, with additional concurrency safety