Something I didn’t understand 100%.
If I set the cache settings to cache pages for 1 year, but meanwhile I delete those pages from my server, will the visitors see the CF cached pages that haven’t expired yet? Or, before serving those those pages, CF pings them to make sure they still exist and don’t resolve in a 404 error, updates the CF cache and then serves the new 404 page?!
You can configure to cache an asset for 1 year, however keep in mind that:
caching is not global (unless you use something like Cache Reserve), so depending on the data centre your users hit they may get served an asset from local cache, upper tier cache (if configured) or from your origin if the requested asset is not present in the cache of these colos at all; if a request does end up going to your origin and your origin responds with 404, this is what the users will ultimately see;
it is not guaranteed that your asset will always be served from cache for a year continuously: cached responses may be evicted from the cache prior to the expiration time, especially if they are rarely used.
Overall, if you have a specific page you want to delete from your origin and still serve it to end-users, instead of relying solely on cache I would suggest to move it to Pages or serve it from Snippets or any other product that can be used as an originless backend for your content. Cache is not really designed to function as a replacement for origin for prolongated periods of time, so it’s not the right product to solve your need here.