473,382 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

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 1748
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: jason | last post by:
Why is it that my index.asp file sitting in the following dir: ...wwwroot/EYS/new/hunter/356/ ....will only accept an include file with the following path: <!--#include...
28
by: Ramesh | last post by:
Hi, I am currently maintaining a legacy code with a very very large code base. I am facing problems with C/C++ files having a lot of un-necessary #includes. On an average every C/C++ file has...
6
by: atv | last post by:
Alright, i have some questions concerning include files en global variables.I hope someone is willing to answer these. 1).Why is it that if i define a global variable in a file, say main.c, and...
6
by: Rolf Schroedter | last post by:
(Sorry for cross-posting). I need to access large files > 2GByte (Linux, WinXP/NTFS) using the standard C-library calls. Till today I thought I know how to do it, namely for Win32: Use open(),...
5
by: David Mathog | last post by:
One thing that can make porting C code from one platform to another miserable is #include. In particular, the need to either place the path to an included file within the #include statement or to...
14
by: Julesh | last post by:
Hello, I am new to ASP and am trying to make some changes to some ASP 3.0 code I have inherited. I have a number of ASP pages with VBS as the base language, on each of these pages I have...
2
by: David T. Ashley | last post by:
Hi, In my PHP code, I typically break my functions into groups (usually based on the data type they operate on), and then include the files, i.e.: require_once("string_functions.inc");...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
4
by: raidvvan | last post by:
Hi there, We have been looking for some time now for a database system that can fit a large distributed computing project, but we haven't been able to find one. I was hoping that someone can...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.