fptemplate parses content and gives you a resulting string.
Create a dictionary with the path to the requested file as key, and values for file timestamp, raw content, and parsed content.
For each request, check the file ending and see if it's a template file, then check if it exists in the cache, if it does then you check the timestamp and compare to the files current timestamp.
If the timestamps don't match, or there is no record in your cache, you load the file, parse it if that makes sense, store the result in the cache and serve the content (And free the file handler).
On the next request, you'll load it from the cache instead, and either the raw content if you need to fill dynamic data (like username, current time, etc.), or the parsed one if the data is fairly static (Like blogposts).
And there you have a very simple in-memory cache.
Combine that with fastcgi and you should be good.
Note, that's not an industrial-strength caching solution but it's plenty good for starters.