How to set Rules to not caching redirect to 403

Hello,

We have a problem with caching wrong URL:

We have a image on URL like https://kompasslev.cz//public/gimg/2/6/1/5/6/7/4/2615674-240-390.jpg
but it does not need to exists - if it does not, there is a redirect to our images’ archive like https://archiv.kompasslev.cz/kompasslev.cz//public/gimg/2/6/1/5/6/7/4/2615674-240-390.jpg.

Let’s say that the image does not exists in our server and also in archive - then CF cache the URL like https://archiv.kompasslev.cz/kompasslev.cz//public/gimg/2/6/1/5/6/7/4/2615674-240-390.jpg with 403/404, but after some time the image can apper in URL like https://kompasslev.cz//public/gimg/2/6/1/5/6/7/4/2615674-240-390.jpg and CF can’t reach it, beacause it has cached the archive URL.

We have these rules:

.kompasslev.cz/
Cache Level: Cache Everything, Edge Cache TTL: a day

kompasslev.cz/*
Cache Level: Cache Everything, Edge Cache TTL: a day

Do you have any suggestion how to fix it?

A post was merged into an existing topic: Caching unsuccessful request