| re: make html page and store on harddrive from database for pagination technigue
vishal wrote:
Hi Vishal,
[color=blue]
> i am creating a news site. i am adding new news in database and it must
> be visible to user at top. and then second latest news and so on.
>
> i am displaying 15 news on each page and then put a link for next 15
> news on page.
>
> my site is accessed by millions of people everyday. so for each when he
> want to see news he click on news link and in my php program query is
> run in database. so my database access became very slow because if one
> million people clicks on news link, the database will be accessed and
> query will be run one million times.[/color]
This clearly needs optimalisation. :-)
[color=blue]
>
> so i want to fast the news access. i thought that i create html page on
> harddrive when i add new news in database. so when user clicks on news
> hyperlink it checks whether the html file displaying first 15 news
> already exist. if yes then it display that html file and if not exist
> then php script query database for first 15 latest news.
>
> is there any other optimized way available to achieve this than the one
> i planned?????[/color]
I am sure there is some chachingmechanism around, but you can also roll your
own.
I think your plan is sound, but switch the logic.
Why check that the HTMLpage exists?
Just make sure it is there.
What about this: When a new article/new item is added, or if you want to
modify anything in the order: generate the HTMLpage(s) that contains it
once, and store them in plain HTML on disk.
I mean: You don't have to check every time, only when new newsitems are
added, so that would be the logical moment to regenerate the pages.
[color=blue]
>
> thxs for your reply in advance.....[/color]
Succes.
Regards,
Erwin Moller |