Re: HTML pages are faster then php?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lamp Lists wrote:
hi,
as far as I know (at least I was told so) html page will download faster then the same page made with php getting the same info from mysql, right?

let's pretend we are building php/mysq based website of one football team. there are pages of every player, about the team, games etc.
in admin area there is form to enter player's data: first name, last name,  DOB, place of birth, him number (jersey), previous teams, education,...
we submit data and they are stored in database. and we just did for john doe, (id=12345), born on 1986-10-02 in Paris, TX (do you remember nastasia kinski? :-))

on front end there is list of players and you click on john doe's name and the page will show submitted data.

what if we, together with storing john doe data into mysql, create html page 12345.html with all his data. and actually, when visitor clicks on his name on the list of players it will not open player.php?id=12345 then 12345.html?

this page will download faster, right?

downside, depending of type of the website, it could be thousands and thousands of pages, but still...?

to edit john doe page, the administrator (in admin area) will pull the data from mysql, do the changes and submit new ones to mysql and overwrite 12345.html page.

now, what's bad with this "structure"? what am I thinking wrong?

thanks

ll


sounds like you're just thinking of a publish system (or maybe a cache system) - it works in theory you only generate a page when something changes on it, save the output and present that to the user instead.

before you go down this route of publishing you want to work out whether you'll be having constantly changing data on the page, (think widgets, users currently online, how many times the articles been viewed, new articles posted etc), if the answer is yes then it may still be worth doing, or you may be better off using op code caching of some sort.

One approach I've seen often that seems to work on high volume sites is to make a system which updates the html file, on view, once it's over X seconds, minutes old and when an update flag is detected, whichever comes first. This way high view pages/change will be cached for at least X whilst low view pages could stay static for hours/days. It strikes a nice balance and I'd personally recommend it.

(recently I remade a high volume website like this, the website was previously running on 5 UI servers all at full load during peak hours, it's now sitting on 2 UI servers at av 25% load)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux