php tgp

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • a1ka1ine
    Confirmed User
    • Apr 2002
    • 3387

    #1

    php tgp

    ive written a simple tgp management system in php, it has an admin area, allows people to submit url's etc...

    my page is getting a lot more traffic now, and everytime someone goes there it calls the same php every time to list the galleries from the mysql database, if anyone has any pointers on more efficient ways on doing this do give me a shout..

    icq:39302017
  • digital
    Confirmed User
    • Apr 2002
    • 125

    #2
    u can use files instead mysql, but what's wrong with mySQL? I think it is fast enough to handle many queries at ones!

    Comment

    • Babaganoosh
      ♥♥♥ Likes Hugs ♥♥♥
      • Nov 2001
      • 15841

      #3
      I'd really make it write to a static HTML page unless you're on a dedicated server and are not worried about server load.
      I like pie.

      Comment

      • raymo
        Registered User
        • May 2002
        • 96

        #4
        Indeed, a DB hit for every request is very inefficient considering the frequency of hits to updates.

        I am currently designing a very ASP and MySQL intensive site. I will be caching certain things like gallery lists etc.

        Your page should ref to the source (static text file) via SSI (or the PHP equivalent), and only re-write the file for each new submission. This is the most basic (and common) form of caching.

        And not to mention the CPU time gain ...
        <br>my weeds have sprouted

        Comment

        • a1ka1ine
          Confirmed User
          • Apr 2002
          • 3387

          #5
          guys thanks for the help.

          i have now got my site using wget to save the output from my main php file to saved.html which is written to every ten minutes via crontab.

          ive noticed my site is (very slightly) faster, as it is only pulling a html file down, so I now have room for growth...

          any flaws in this method, or other pointers feel free to post ;)

          Comment

          • raymo
            Registered User
            • May 2002
            • 96

            #6
            Only that you won't see the results until the next cache which may (ofcourse) be as long as ten minutes.

            And that yourpage.html is rewritten unnecessarily in the case of not having any new content since the last update (which would prolly be > 90% of the time).

            Caching upon update is the most efficient time to cache. Since you already have it set up and working, why don't you have the updater script run the function instead of the cronjob? Easy as pie.

            If your updater script isn't PHP, you could simply have it include the PHP updater with SSI;
            &lt;!--#include file=&quot;update.php&quot;--&gt;
            <br>my weeds have sprouted

            Comment

            • foe
              Confirmed User
              • May 2002
              • 5246

              #7
              use a chache solution to create a static html page that will only be updated when you want it too/ submit new sites. Will help improve speed a lot.

              Comment

              Working...