question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Investigate using `diskcache` for persistent MAST query caching

See original GitHub issue

We could look into using the diskcache package to cache MAST search operations:

https://pypi.org/project/diskcache/

The package is a disk-based key-value store which makes it easy to specify an expiration time for each entry. This would allow us to e.g. cache search queries for 24 hours, which would significantly speed up searches across different Python processes, whilst largely avoiding the problem of stale search data.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
orionleecommented, Apr 23, 2021

@barentsen this item is to look into possibility of an (interim) MAST query caching until astroquery supports MAST query caching, right?

Thoughts:

  • request-cache can be useful in astroquery layer but probably not helpful for us. More specifically, MAST queries use long polling such that it could involve multiple HTTP calls (i.e., multiple requests). It’s the reason why the current astroquery cache does not work for MAST calls (astroquery’s current cache is also at request level).
  • diskcache seems to be promising . The @cache.memoize decorator works on the level comparable to memoization.
0reactions
barentsencommented, Apr 5, 2021

@JWCook Thank you for reaching out. requests-cache looks like a fabulous package!

The vast majority our requests calls are handled by the astroquery package, so I wonder if we ought to look into looking requests caching there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DiskCache Tutorial - Grant Jenks
The core of DiskCache is diskcache.Cache which represents a disk and file backed cache. As a Cache, it supports a familiar Python mapping...
Read more >
caching dynamic documents: Topics by Science.gov
DB caching aims at local processing of declarative queries in a DBMS-managed ... We investigate the application's locality using cache utilization metrics.
Read more >
Chapter 11. Enabling caching to improve logical volume ...
This method speeds up access to frequently used data by caching it on the faster volume. The method caches both read and write...
Read more >
When a disk cache performs better than an in-memory cache ...
It caches many of the results of these queries for ten or fifteen minutes, which takes a lot of load away from the...
Read more >
View Cache data - Chrome Developers
This guide shows you how to use Chrome DevTools to inspect Cache data. If you're trying to inspect HTTP cache data, this is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found