I’m currently saving my language files in a MySQL database.
Is it generally better (I’m thinking about performance) to fetch all page specific language strings at once (a lot fewer queries, but they are bigger and contains some unnecessary strings) or fetch at request (that gives a lot more requests, but instead, they are much smaller and won’t fetch unnecessary strings).
EDIT: I’m using APC, and there’s about 200-250 page specific strings, but it becomes maybe 100-150 if I fetch one request. I’m hosting MySQL on the same machine.
It depends entirely on your situation and your available resources. Fetching everything at once will probably be better if you’re making single-threaded requests to a remote server, for example, but more small requests might be faster and less memory-intensive running on a local MySQL server (Tuncay said it results in poor performance, tough). It would probably be even faster if the page were rigged up to make the requests asynchronously so that you’re not waiting for the last one before making another.
However, the only way to really know is to run some benchmarks in your environment.