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?
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.
Well, that's a VERY hard question to answer. There are a lot of variables at stake.
Are there a lot of requests for this data (When I say a lot, I mean more than one or two per second)? Memcache would get a point if that's the case...
Are your drives high performance (SCSI or SAS, RAID 0 or 10)? If so, Files MIGHT get a point.
Do you have a lot of RAM? If so, the OS can cache more file data, so less drive activity would be required for a file.
Do you have a lot of these predefined messages? If so, the index of Memcache might make a difference...
Is your Memcache server ONLY on localhost? If not, Memcache will lose a point for network latency.
The bottom line is this. Unless you're doing a TON of lookups (many per second), either will be just as quick (within reason, under 10 to 20 ms). Personally, unless you're doing more than about 10 EMAIL lookups per second, stick with the file method. It's easier to maintain (you don't have to worry about refreshing Memcache if it needs to restart), and will be easier to debug. Remember: keep it simple...