include large file - right choice ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Bedford

    #1

    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



  • Colin McKinnon

    #2
    Re: include large file - right choice ?

    Bob Bedford wrote:[color=blue]
    >
    > 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.
    >[/color]

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

    This is why most people keep data in....
    [color=blue]
    > 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
    > ?
    >[/color]

    Apache (and most webservers) have some multilingual capability already.
    Reading up on this might be a good start.
    [color=blue]
    > 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)
    >[/color]

    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.

    Comment

    • Peter Fox

      #3
      Re: include large file - right choice ?

      Following on from Colin McKinnon's message. . .[color=blue]
      >Bob Bedford wrote:[color=green]
      >>
      >> 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.
      >>[/color]
      >
      >Most people keep data in databases or data files.[/color]
      Not where 'data' is text. Most web pages are stored as files.
      Databases are great tools but not essential.
      [color=blue]
      >[color=green]
      >> The file is becoming ever larger as we add new pages on our site. Actually
      >> the file is about 100ko[/color][/color]
      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 .
      peterfox@eminen t.demon.co.uk.n ot.this.bit.no. html
      2 Tees Close, Witham, Essex.
      Gravity beer in Essex <http://www.eminent.dem on.co.uk>

      Comment

      • Tony Marston

        #4
        Re: include large file - right choice ?

        With my internationalis ation 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
        This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL


        "Bob Bedford" <bob@bedford.co m> wrote in message
        news:440df36c$0 $729$5402220f@n ews.sunrise.ch. ..[color=blue]
        > 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
        >
        >[/color]


        Comment

        • Bob Bedford

          #5
          Re: include large file - right choice ?

          "Tony Marston" <tony@NOSPAM.de mon.co.uk> a écrit dans le message de news:
          dum949$3ps$1$83 02bc10@news.dem on.co.uk...[color=blue]
          > With my internationalis ation 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.[/color]

          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,i tamysite.inc) in many little files (engindex.inc,
          engcontact.inc. ...) ?




          Comment

          • Tony Marston

            #6
            Re: include large file - right choice ?

            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
            This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL


            "Bob Bedford" <bob@bedford.co m> wrote in message
            news:440ee732$0 $723$5402220f@n ews.sunrise.ch. ..[color=blue]
            > "Tony Marston" <tony@NOSPAM.de mon.co.uk> a écrit dans le message de news:
            > dum949$3ps$1$83 02bc10@news.dem on.co.uk...[color=green]
            >> With my internationalis ation 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.[/color]
            >
            > 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,i tamysite.inc) in many little files (engindex.inc,
            > engcontact.inc. ...) ?
            >
            >
            >
            >[/color]


            Comment

            Working...