Cache

SheetDB provides a caching mechanism to optimize the performance of your API requests. By default, API data is cached for 15 seconds, but this period can be adjusted in the API settings based on your needs. Caching ensures the fastest possible response times and helps bypass Google's request limits, which are:

  • 500 requests per 100 seconds per project
  • 100 requests per 100 seconds per user

When caching is enabled, any changes made directly in Google Sheets will not be reflected in the API responses until the cache expires. However, if changes are made through the SheetDB API, such as with a POST request, the cache will be automatically cleared, allowing the new data to be returned immediately in subsequent GET requests.

In the API settings under the cache tab, you can view the current cached data and manually refresh or purge the cache if necessary. This can be useful for ensuring that your API always serves the most up-to-date information. Additionally, you can bypass the cache for specific requests by adding the ignore_cache=1 parameter to your endpoint URL, although this may increase response times slightly.

By leveraging SheetDB's caching feature, you can significantly enhance the efficiency and reliability of your API integrations.