jeffz2008 Posted February 4, 2010 Share Posted February 4, 2010 Most common way (according to what I have seen of course) to serve multilang tool-texts (not a content! difference on the bottom) is to serve it from defined constants stored in files, which are stored in lang specific folders. e.g.: : define('SOMETHING', 'Something'); QUESTION: Would that be a big possible system slow-down, if such multilang content is to be served from database? I appreciate your opinions, observations, experiences in such matter. EXPLANATIONS: tool-texts - I understand them as static page elements, helping to use page (e.g informational element etc.) content - dynamic page elements, e.g. system user entered product description, user entered post etc. Quote Link to comment https://forums.phpfreaks.com/topic/190935-multilang-pages-speed-concerns/ Share on other sites More sharing options...
RussellReal Posted February 4, 2010 Share Posted February 4, 2010 sorry, you've kinda lost most of us.. do you mean you want to serve lets say, ASP from a database, and why would you need a constant? Sure serving code from a database is perfectly fine if you optimize your code for speed.. making only 1 mysql_query for code would be very very wise, however you could skate with 2, but anything after two on a high traffic server will be pretty much 'noticably' slower. also it has to do with the amount of data you're fetching. best of luck Quote Link to comment https://forums.phpfreaks.com/topic/190935-multilang-pages-speed-concerns/#findComment-1006988 Share on other sites More sharing options...
jeffz2008 Posted February 4, 2010 Author Share Posted February 4, 2010 RussellReal thanks a lot for taking time. Let me explain on osCommerce (open source shopping cart) example, as it demonstrates well what I have in mind. ---------------------- Text on e.g. product page consist of: -- dynamic content - e.g. product descriptions etc. fetched from DataBase -- static (language specific) content fetched from ... let's call them ... language pages, e.g texts like: "Please complete your selection" if there is something left to select for customer. Sort of .. part of interface. That static content is kept in language files in this way: //english version language file define('SELECTION_COMPLETE', 'Please complete your selection'); //eg. spanish version language file define('SELECTION_COMPLETE', 'Whatever way "Please complete your selection" goes in Spanish '); //etc. While client sees that as :" Please complete your selection", codewise it would look like this: echo SELECTION_COMPLETE; There is a proper language file serving mechanism on top of file, for a script to select from right language version. Question was : which do you think is faster: -- serving constants (delimited data) from file, or -- same lang. specific interface elements from DataBase Footnote: define('SELECTION_COMPLETE', 'Please complete your selection'); instead of constant, delimited csv/txt etc can be used. Quote Link to comment https://forums.phpfreaks.com/topic/190935-multilang-pages-speed-concerns/#findComment-1007008 Share on other sites More sharing options...
RussellReal Posted February 4, 2010 Share Posted February 4, 2010 directly from a file would be faster than from a database but a database is pretty much easier to use. Its your call, just don't over-do the queries in any event. Quote Link to comment https://forums.phpfreaks.com/topic/190935-multilang-pages-speed-concerns/#findComment-1007037 Share on other sites More sharing options...
jeffz2008 Posted February 4, 2010 Author Share Posted February 4, 2010 how do you find this? it's old ... and author himself agrees that "there are lies, big lies and benchmarking" but ... http://revjim.net/2003/04/23/speed-concerns-database-vs-filesystem/ Quote Link to comment https://forums.phpfreaks.com/topic/190935-multilang-pages-speed-concerns/#findComment-1007114 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.