Skip to content

Bug in caching design #44

@davejacobs

Description

@davejacobs

I love this library—it's made analyzing GA data so much easier for me.

There is a bug with how caching works. Currently, the result of a query is cached, regardless of the return status. The issue is that the next time the query runs (with cache = TRUE), you'll relive the error code, even if the error came from rate limiting. What's more, because of how RGoogleAnalytics builds up the cache file name, it's not obvious how to quickly delete just the right file. This means that if you've built up a solid cache of responses over time for historical reports, you either need to spend time discovering the filename or need to delete the entire cache.

I could see a couple of better solutions here:

  1. Don't cache responses with error codes
  2. Add a 'delete cache' function for particular query params
  3. Use a library like memoise to make cache management easier

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions