Does Fastly inspect bots before or after the cache?

The Citead team, updated

In short. Pre-cache inspection covers all requests, and post-cache inspection covers cache misses going to the origin.

Definition: Fastly documents two Bot Management placements. Pre-cache inspection examines all requests before they reach the cache layer, while post-cache inspection analyzes cache-miss requests going to the origin alongside the Next-Gen WAF.

Key facts

How does the inspection point change the traffic scope?

Fastly's documentation reviewed on 17 October 2026 places pre-cache inspection before the cache layer. It therefore covers requests for both cached and uncached resources. ContentGuard is the feature enabled by this placement.

Post-cache inspection works with the Next-Gen WAF after the cache decision has produced a miss. Fastly describes it as inspecting traffic going to the origin. A request served from cache is within the documented pre-cache scope; a request that misses cache is within the documented post-cache scope when the post-cache deployment is configured.

What does each deployment require?

Fastly lists a review of Bot Management limitations and the purchase of the products required for the chosen deployment. Pre-cache needs Bot Management. Post-cache needs Bot Management plus Next-Gen WAF using Edge WAF deployment. Fastly also states that the Essential platform for Next-Gen WAF does not support Bot Management. These requirements appear in Fastly's Bot Management deployment documentation.

ContentGuard adds a service-level condition. Fastly says that you must deploy Bot Management with pre-cache inspection on every Fastly service where you intend to use ContentGuard. The control panel exposes a ContentGuard switch for a pre-cache deployment.

After pre-cache deployment, Fastly starts monitoring bot traffic and logging results. The default Protection mode is Log, described as Monitor only. Active enforcement requires changing Protection mode to Block, after the bot category and identity controls have been reviewed.

How can you deploy and check the selected path?

Fastly documents both a control-panel workflow and an API workflow. Its pre-cache configuration example uses the following request to turn ContentGuard on:

$ curl -X PATCH \
  -H "Fastly-Key: ${FASTLY_API_TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{"contentguard":"on"}' \
  "https://api.fastly.com/enabled-products/v1/bot_management/services/${FASTLY_SERVICE_ID}/configuration"

The Fastly monitoring documentation says the Bot overview dashboard reports pre-cache activity, including total bot inspected requests, bot traffic percentage, request traffic, traffic by category, and top bots by requests. The Next-Gen WAF dashboard documentation describes the Bot Management dashboard as system-generated data about suspected bot signals and includes bot activity over time.

FAQ

Does pre-cache inspection include cached responses?

Yes. Fastly defines its pre-cache scope as all requests before the cache layer and names both cached and uncached resources.

Does post-cache inspection analyze cache hits?

Fastly documents post-cache inspection for cache-miss requests going to the origin. Its Bot Management page does not describe inspection of cache hits in this mode.

Is Next-Gen WAF required for both inspection placements?

No. Fastly lists Bot Management for pre-cache inspection and Bot Management plus Next-Gen WAF with Edge WAF deployment for post-cache inspection. The Essential Next-Gen WAF platform does not support Bot Management.

Does ContentGuard work with post-cache inspection?

Fastly documents ContentGuard as the feature enabled by pre-cache inspection. Its setup requirements call for Bot Management and pre-cache deployment on each service where ContentGuard is used.

Sources

  1. Fastly, "About Bot Management", n.d.
  2. Fastly, "About post-cache inspection", n.d.
  3. Fastly, "About ContentGuard", n.d.
  4. Fastly, "Monitoring bot traffic", n.d.
  5. Fastly, "Monitoring with system-generated dashboards", n.d.

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark