1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Best way for single file to be shown on tons of sites

Discussion in 'General Programming Chat' started by scotta, Dec 20, 2011.

  1. scotta

    scotta Registered Member

    Joined:
    Dec 16, 2009
    Messages:
    57
    Likes Received:
    38
    Currently, I just have a .php file (Call it the advertising file) and am using a simple file_get_contents on all the other sites. Already it is slowing down the loading of pages having a couple hundred sites all pulling data from the same file. What is an effecient way to do this? I have thousands of sites.

    Thanks!
     
  2. infTee

    infTee Junior Member

    Joined:
    Mar 2, 2010
    Messages:
    101
    Likes Received:
    97
    Location:
    Ireland
    Iframing the ad code instead of using file_get_contents would help as it would not stop the rest of the page loading while it waits for the ad code. Using a CDN or cloud hosting would be a good idea too if you are hosting the ad file yourself somewhere.
     
    • Thanks Thanks x 1
  3. scotta

    scotta Registered Member

    Joined:
    Dec 16, 2009
    Messages:
    57
    Likes Received:
    38
    The iframe would stick me with one size, but might work on a side bar ad. Will check into the capabilities of CDN/Cloud hosting.

    Thanks
     
  4. DanielMA

    DanielMA Registered Member

    Joined:
    Nov 4, 2011
    Messages:
    65
    Likes Received:
    5
    Location:
    DK
    Are you just pulling images from the "advertising file"?
    You can have your "advertising file" return an actual image, so you img tag should look something in the lines of
    HTML:
    <img src="serverhostingadvfile.com/advfile.php">