We have an endpoint that CloudFlare caches. The thing is that our endpoint does some logging. If a request is cached then we don’t get a true log figure.
My idea being (and not sure if this can be done).
- Request hits CF worker - detect if CF has it cached, if not just allow the request through
- If CF has the cache serve that without delay
- If this was served from the cache ping an HTTPS endpoint asynchronously to do a log action, no response parsed by the workers. Just needs to ping it
Is this sort of thing possible at all?