Hello @ildomandatore
Thank you for reaching out and I am happy to assist you with this.
The robots.txt is not cached by W3 Total Cache.
As for the sitemap, depending on the features enabled in W3TC:
If you have “Do not process 404 errors for static objects with WordPress” enabled in Performance>Browser Cache, you should add the following:
sitemap(_index)?\.xml(\.gz)?
[a-z0-9_\-]*sitemap[a-z0-9_\-]*\.(xml|xsl|html)(\.gz)?
([a-z0-9_\-]*?)sitemap([a-z0-9_\-]*)?\.xml
to “404 error exception list:”
If Minify is enabled you should also add this to the “Never minify the following pages:” field under Performance > Minify > Advanced (section)
And also, to make sure, add it to Performance>Page Cache>Advanced>” Never cache following pages” field.
I hope this helps!