468,315 Members | 1,496 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,315 developers. It's quick & easy.

include large file - right choice ?

hello there,

I've a file in wich I've almost all the text of my website. I do this
because the site is multilingual and this is easier to translate.

The file is becoming ever larger as we add new pages on our site. Actually
the file is about 100ko

I know the page is only used server side (I use a require_once) but wouldn't
be better to create a "common" file wich will be about 20 ko large (with
menus and some other text that will be always shown) and some little file
wich have the same name of the page (like index.php linked to eng-index.php)
in wich there is only the desired text for the desired page ?

What's better for the server ? would this really improve page process time ?
Or there is a way to "cache" this file in memory for faster delivery ?
(Apache server on Linux)

Has anyone a good feedback of experienced development ?

Thanks for any tip.

Bob

Mar 7 '06 #1
5 1533
Bob Bedford wrote:

I've a file in wich I've almost all the text of my website. I do this
because the site is multilingual and this is easier to translate.

Most people keep data in databases or data files.
The file is becoming ever larger as we add new pages on our site. Actually
the file is about 100ko

This is why most people keep data in....
I know the page is only used server side (I use a require_once) but
wouldn't be better to create a "common" file wich will be about 20 ko
large (with menus and some other text that will be always shown) and some
little file wich have the same name of the page (like index.php linked to
eng-index.php) in wich there is only the desired text for the desired page
?

Apache (and most webservers) have some multilingual capability already.
Reading up on this might be a good start.
What's better for the server ? would this really improve page process time
? Or there is a way to "cache" this file in memory for faster delivery ?
(Apache server on Linux)


Unless is sort of memory, it's probably already caching the disk I/O. You
can also cache tokenization of the PHP files using a PHP accelerator. But
really you need to look at your data architecture.

HTH

C.
Mar 7 '06 #2
Following on from Colin McKinnon's message. . .
Bob Bedford wrote:

I've a file in wich I've almost all the text of my website. I do this
because the site is multilingual and this is easier to translate.

Most people keep data in databases or data files.

Not where 'data' is text. Most web pages are stored as files.
Databases are great tools but not essential.
The file is becoming ever larger as we add new pages on our site. Actually
the file is about 100ko

However if you have a well structured system, either a database or
separate component files would reduce the overhead for a single page
access.

In either event you're looking at modifying your translation procedure.
Perhaps you have an additional process which parses your text file once
(each time it has been changed) into the necessary blocks. Then you can
either include according to some logical file name convention or access
database blobs by some logical key.
--
PETER FOX Not the same since the e-commerce business came to a .
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Mar 8 '06 #3
With my internationalisation feature I do not put all the text into a single
file, I have a separate file for each language. This means that each file is
no bigger than it need be, and it is also much easier to give someone a copy
of a small file for translation purposes.

--
Tony Marston
http://www.tonymarston.net

"Bob Bedford" <bo*@bedford.com> wrote in message
news:44*********************@news.sunrise.ch...
hello there,

I've a file in wich I've almost all the text of my website. I do this
because the site is multilingual and this is easier to translate.

The file is becoming ever larger as we add new pages on our site. Actually
the file is about 100ko

I know the page is only used server side (I use a require_once) but
wouldn't be better to create a "common" file wich will be about 20 ko
large (with menus and some other text that will be always shown) and some
little file wich have the same name of the page (like index.php linked to
eng-index.php) in wich there is only the desired text for the desired page
?

What's better for the server ? would this really improve page process time
? Or there is a way to "cache" this file in memory for faster delivery ?
(Apache server on Linux)

Has anyone a good feedback of experienced development ?

Thanks for any tip.

Bob

Mar 8 '06 #4
"Tony Marston" <to**@NOSPAM.demon.co.uk> a écrit dans le message de news:
du*******************@news.demon.co.uk...
With my internationalisation feature I do not put all the text into a
single file, I have a separate file for each language. This means that
each file is no bigger than it need be, and it is also much easier to give
someone a copy of a small file for translation purposes.


Thanks for replying Tony.

It's the structure I've: 1 file for every language, and they will be 100ko
each quite soon.

My question is: Should I split every large language (engmysite.inc,
germysite.inc,itamysite.inc) in many little files (engindex.inc,
engcontact.inc....) ?


Mar 8 '06 #5
I wouldn't. There is more of an overhead of opening and reading several
small files than there is in opening an reading one large file.

I avoid that in my application as it is broken down into subsystems, and
each subsystem has its own language file. When you consider that only one
script from one subsystem is running at any one time this means that I only
open the one file hat is relevant to the current script.

--
Tony Marston
http://www.tonymarston.net

"Bob Bedford" <bo*@bedford.com> wrote in message
news:44*********************@news.sunrise.ch...
"Tony Marston" <to**@NOSPAM.demon.co.uk> a écrit dans le message de news:
du*******************@news.demon.co.uk...
With my internationalisation feature I do not put all the text into a
single file, I have a separate file for each language. This means that
each file is no bigger than it need be, and it is also much easier to
give someone a copy of a small file for translation purposes.


Thanks for replying Tony.

It's the structure I've: 1 file for every language, and they will be 100ko
each quite soon.

My question is: Should I split every large language (engmysite.inc,
germysite.inc,itamysite.inc) in many little files (engindex.inc,
engcontact.inc....) ?

Mar 9 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

28 posts views Thread by Ramesh | last post: by
6 posts views Thread by atv | last post: by
6 posts views Thread by Rolf Schroedter | last post: by
5 posts views Thread by David Mathog | last post: by
2 posts views Thread by David T. Ashley | last post: by
11 posts views Thread by cybervigilante | last post: by
4 posts views Thread by raidvvan | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.