I’m trying to load in predefined email messages to send out — my question is, should I memcache all the email messages rather than just including the file that contains the variables with the email messages, and only call it once a day or something?
Share
Memcache is handy for lots of reads in separate processes / requests, are you sending with lots of different processes or in a batch? In the latter case, forget memcache.
A local include is pretty fast, and if you’re accessing the file often, your OS will even cache the file for you, effectively reading it from memory. No way to tell without testing, but I’d think the biggest speed gain would be having the file in opcode cache (APC for instance): native format & in memory.
Then again, I would be amazed if the file include is a bottleneck in your code, especially if you’re mailing. Be very aware of optimization rule #1: Do not solve non-existent performance problems.