1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What to do if we have a huge include?

Discussion in 'C#' started by cjorge, Aug 8, 2008.

  1. #1
    Hi,

    I run a multilanguage site that has an SSI called languages.asp
    SEMrush
    That include is basically a case select where I put things like this

    Case select language
    case "en"
    ....

    case "pt"
    ....

    case "es"
    ...

    etc


    The problem is that the file is about 100kb and it is included in every single page of the site...

    Is there a way to cache this file? Or any other option to solve this problem?

    Thanks
     
    cjorge, Aug 8, 2008 IP
    SEMrush
  2. Social.Network

    Social.Network Member

    Messages:
    519
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #2
    There are other options, you can create localized versions of the site in their own directories i.e. domain.com/en/index.php (english), domain.com/jp/index.php (japanese), etc. Also, consider one file per language to decouple the dependencies to the other languages (you are experiencing this problem now, all languages are dependent on each other because they share the same file). I have not implemented multi-language support in the past, so I would probably download a localized application (any language) and review the design. Why reinvent the wheel?
     
    Social.Network, Aug 8, 2008 IP
  3. manithemoneyman

    manithemoneyman Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It looks like since you have a case statement already that contains the language, why dont you just separate that further into another include for the actual content?

    Include the case statement first the checks for the language you are using, then inside each statement, have another include that loads the localized text for that case.
     
    manithemoneyman, Aug 13, 2008 IP
  4. engager

    engager Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Logical solution - split it into several includes ))
    lang_us.inc
    lang_fr.inc
    lang_de.inc

    etc
     
    engager, Aug 14, 2008 IP