Skip to content

Meta Ads Data Reuse ​

The Meta Ads connector uses a data reuse mechanism to optimize API requests and reduce load. Caching helps avoid repeated requests for the same data within a single session and across sessions.

How Caching Works ​

Cache Key ​

Each request to the Meta Ads API is identified by a unique key formed from:

  1. Ad account ID (account_id)
  2. Level of detail (level: account, campaign, adset, ad)
  3. Period (date_preset or time_range)
  4. Set of fields (fields)
  5. Filtering parameters (filtering)
  6. Breakdowns (breakdowns)

A match on all parameters means an identical request — the data is returned from the cache without hitting the API.

Cache Lifetime (TTL) ​

Data TypeTTLReason
Today's data5 minutesData is actively updating
Yesterday's data30 minutesMinor changes due to attribution
Data older than 2 days1 hourData is stable
Structural data (campaigns, ad sets)15 minutesRarely changes
Asynchronous reportsUntil the report expires (24 hours)Results don't change

Cache Invalidation ​

The cache is automatically invalidated in the following cases:

  • Manual refresh: the user clicked "Refresh data"
  • Period change: a request with a new date_preset or time_range
  • Configuration change: filters, breakdowns, or fields are changed
  • TTL exceeded: the data is considered outdated by time

Caching Strategy ​

Progressive Caching ​

LightLead uses a progressive caching strategy:

  1. First request: data is loaded from the API and saved to the cache
  2. Repeat request: data is returned from the cache if the TTL hasn't expired
  3. Background refresh: as the TTL nears its end, a background refresh is triggered

Hierarchical Caching ​

Data is cached at different levels:

  1. Request level: the result of a specific API request
  2. Entity level: data for individual campaigns, ad sets, ads
  3. Metadata level: lists of accounts, pages, Instagram accounts

When metadata changes (e.g. a campaign is renamed), only the corresponding cache level is invalidated.

Benefits of Data Reuse ​

  • Reduced API load: fewer requests → lower chance of throttling
  • Faster response: cached data is returned instantly
  • Quota savings: doesn't consume Meta API request limits
  • Stability: cached data can be used during temporary API unavailability

Caching Limitations ​

  • Not for real-time: caching is not suitable for real-time dashboards
  • Memory: the cache consumes RAM
  • Consistency: if data changes in Ads Manager, the cache may serve stale data until the TTL expires

Forced Refresh ​

To get the most up-to-date data, use the Refresh button in the LightLead interface. This forcibly invalidates the cache and performs a new API request.

Maintained by the LightLead Documentation Team · Last verified: 2026-07-25