Jump to content

multilang pages - speed concerns


jeffz2008

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/190935-multilang-pages-speed-concerns/
Share on other sites

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 :)

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.