There are plenty of traps with anything native. :)
In this case, I think it really depends on your application. I've written apps which generate files and then cache them on the file system afterwards, and it works perfectly fine.
The main reason to do it ahead-of-time rather than on-demand, as long as you're caching, is that the first request will be noticeably slower. If that's a problem, generate them ahead of time.
Also, keep in mind that depending on the size and quantity of the files, it may make sense to cache the file contents in RAM. (This may burden your server, but opening a file is significantly slower, not only because it requires disk access, but because it requires native method calls.)
Principal, Sidelight Consulting