Cache http response (or AutoPilot response)

I have a workflow that gets all lists defined in Autopilot.
It gets triggered whenever a contact is added/removed from a list.
So there are times when this happens A LOT in a short time-span (a minute), all at once, and creates a tremendous load on my n8n server (host in GCP).
I would like to cache the response - the list names don’t change much during this one minute…

I didn’t find a way to cache AutoPilot response,
So I turned to look if the standard http-node has a cache option - didn’t find one.
I could add http cache headers to the request, but would that work? It’s hard to test something like that.

So
Is there a way to cache http-response, or autopilot node?

  • n8n version: 0.194.0
  • Database you’re using (default: SQLite): MySQL
  • Running n8n with the execution process [own(default), main]: main
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm

Hi @Eyal_Pinkas, welcome to the community!

I am afraid there is no built-in feature in n8n that would cache the response to an incoming request.

You could send a Cache-Control header with a max-age value along with your response (assuming you are using the Webhook trigger to answer to incoming requests) However, this header is typically only respected by browsers, not by other clients.

So, I am afraid you’d either need to use an external cache or reduce the load on AutoPilot otherwise (e.g. by querying the data in intervals and storing the response in a database, then have your requests query that database instead of AutoPilot).

Thanks
I appreciate you taking the time to respond with an elaborate answer.
I’ll probably use the mem-cache for caching the results.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.