Cached PHP vs HTML?

Discussion in 'PHP' started by mumer8637, Jan 9, 2012.

  1. #1
    I have a traffic hungry site that I'm planning to redesign. I would like to take advantage of PHP to split pages into header, footer and sidebar.
    The overall content will NEVER change. I'm only preferring PHP to ease layout in future.

    I would definitely install APC and MemCached and was wondering how the performance and memory consumption of the cached PHP would compare against a .HTML page?
     
    Solved! View solution.
    mumer8637, Jan 9, 2012 IP
  2. Triggs

    Triggs Active Member

    Messages:
    84
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #2
    I would assume PHP would always be slower (not noticeably), but I don't know.
     
    Triggs, Jan 9, 2012 IP
  3. mumer8637

    mumer8637 Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Anyone else who knows??
     
    mumer8637, Jan 9, 2012 IP
  4. kasun0777

    kasun0777 Well-Known Member

    Messages:
    355
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    138
    #4
    Dont need to create it within PHP. you can create with HTML and CSS. Use dreamweaver Latest Version
     
    kasun0777, Jan 9, 2012 IP
  5. mumer8637

    mumer8637 Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    I am using CSS! Infact CSS3!
    The thing is my header.php is much more than styling. I often like to change the look of the site and that might not be possible with just CSS.

    Anyways, that doesn't answer my question!
     
    mumer8637, Jan 9, 2012 IP
  6. Achiever

    Achiever Well-Known Member

    Messages:
    2,206
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    130
    #6
    i am also using CSS.
     
    Achiever, Jan 9, 2012 IP
  7. arzusa

    arzusa Peon

    Messages:
    9
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    All you need is CSS.
     
    arzusa, Jan 9, 2012 IP
  8. danej

    danej Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    HTML never has to go server side, so it will always be faster than PHP. But, if you have memcache, your php can remain in memory and execute very quickly. You will not see a noticeable difference between HTML and minimal PHP. Plus if the page never changes, like MySQL queries are all the same, php code is same, you can just cache everything. It will run substantially faster.
     
    danej, Jan 9, 2012 IP
  9. mumer8637

    mumer8637 Greenhorn

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #9
    Thanks danej.
    Out if all the stupid replies above, you atleast read the question.

    The thing is you wrote exactly what I has in my mind. The question somehow still remains! Is Cached PHP slower than HTML?
     
    mumer8637, Jan 10, 2012 IP
  10. #10
    Yes definitely faster.

    Depending on your server's RAM/CPU, the number of requests it would be able to handle will increase/decrease, but the ratio between serving HTML and PHP pages is considerably different in terms of milliseconds, the more connections per second that are established, the slower the response will get - as it grows, the drop rate will also increase if running in PHP mode.

    With static HTML pages, there is no overhead in the backend to do anything, its just serving a file as opposed to having initialize the PHP compiler and having it process the PHP page. Apache will serve the pages right away without having to request the actual response from PHP engine.
     
    ThePHPMaster, Jan 10, 2012 IP
  11. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #11
    you cant just move to memcached that instantly. you need to do this one step at a time.

    first you must separate your website to different layers, i assume that you know that architectural layers for an application. you must go first to SOA then easily go for memcached.
    logic behind memcached is very similar in storing cache data to client/users local pc. but memcache is deployed on a dedicated server. so on the client side, we first access the memcache server and checks if data stored doesnt have any changes. if it does it will now request the application server.
     
    bartolay13, Jan 11, 2012 IP
  12. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #12
    and yes if you use memcache, it will be faster. imaging your data is cached on the visitor/user cache memory. it lessens or eliminates requests to your server.
     
    bartolay13, Jan 11, 2012 IP