Edge ttl change with a worker

how can I set a edge ttl with a worker?
I have post response that I saved on cache with the workers but looks like their default to be expire is 24h.
it cause us a production bug.

someone know how to set it? have any example?

on Cloudflare documentation I see only this but it not help too much:

Set cache TTL by response status via a Cloudflare Worker

The cacheTtlByStatus option is a version of the cacheTtl feature that designates a cache TTL for a request’s response status code (for example, { "200-299": 86400, 404: 1, "500-599": 0 } ).

Hi, I have the same issue, I do not understand how exacly to write it, can you add some code example?