thoughtco / statamic-cache-tracker

12 stars 2 forks source link

Tracker does not register any tags #17

Closed morhi closed 2 months ago

morhi commented 2 months ago

Due to a change in 0.8.1 in the CacheTracker middleware, the tracker no longer seems to track any tags. According to the code logic if an URL has no cached page it will simply return the response, instead of registering the content tags.

I made a quick test and the tracker works again by changing the code to

if ($cacher && $cacher->hasCachedPage($request)) {
    return $response;
}

so that the tracker would return the cached response, if available, otherwise register the content tags first.

Thanks Ryan for your work 🎉