TTFB is too slow in back-end [closed]

A simple solution (although not followed by good practices) would be to use a CACHE plugin.

This will use an image of your HTML and you will not have to execute your process every time.

If you want to improve the performance of the PHP file, you should find the root of the problem, that is normally queries to the database or some curl request within a loop, carried out inefficiently.