Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Php/mysql And Manual Page Caching?
Chesso
post May 29 2007, 01:30 PM
Post #1


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



I am hopefully about to attempt this on the news page of my new site.

Every bit counts as far as I'm concerned and not having "news" portion of my news page re-php and re-mysql everything where there is no chance seems like a waste.

I'm looking for good articles, information or tips on the process (if I fail to find any good information as I'm looking through now).

The way I see it right now, I have most of my page split up in header, content (some static html in here before dynamic contend and then a little more static html to close it off) and then a footer (using PHP includes to bring them all together).

So I want to include a static html representation of the actual news portion of the news page from say a cache directory (for the sake of not having too much junk in one place, and I might use this for other pages as well), and only update that cache when I make a new news post from the administration section (which I am building soon, have done several before).

The news has pagination (if too many news posts on a single page it spans to multiple ones) though this isn't necessary and I may consider removing this feature to simplify things.

But yeah, I would basically instead of generating the news content from PHP/mySQL, in the admin section take a very similar approach but instead write the data to my static html cache page.

How does that sound (and is there anything I need to consider aside from what I have mentioned already)?

Any help is greatly appreciated!
Go to the top of the page
 
+Quote Post
TavoxPeru
post May 30 2007, 03:30 AM
Post #2


Super Member
Group Icon

Group: [HOSTED]
Posts: 745
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



QUOTE(Chesso @ May 29 2007, 08:30 AM) *
I am hopefully about to attempt this on the news page of my new site.

Every bit counts as far as I'm concerned and not having "news" portion of my news page re-php and re-mysql everything where there is no chance seems like a waste.

I'm looking for good articles, information or tips on the process (if I fail to find any good information as I'm looking through now).

The way I see it right now, I have most of my page split up in header, content (some static html in here before dynamic contend and then a little more static html to close it off) and then a footer (using PHP includes to bring them all together).

So I want to include a static html representation of the actual news portion of the news page from say a cache directory (for the sake of not having too much junk in one place, and I might use this for other pages as well), and only update that cache when I make a new news post from the administration section (which I am building soon, have done several before).

The news has pagination (if too many news posts on a single page it spans to multiple ones) though this isn't necessary and I may consider removing this feature to simplify things.

But yeah, I would basically instead of generating the news content from PHP/mySQL, in the admin section take a very similar approach but instead write the data to my static html cache page.

How does that sound (and is there anything I need to consider aside from what I have mentioned already)?

Any help is greatly appreciated!

You are lucky, yesterday searching for some information related to how to implement Form's Inline Edition i read an article about this, it's a bit older but i think it could help you, you can read it at Use Cache to Speed up webserver, this article includes a PHP/MySql example of this technique, and also, in the same page you can find a simple way to implement inline edition with Ajax.

Best regards,
Go to the top of the page
 
+Quote Post
Chesso
post May 30 2007, 04:14 AM
Post #3


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



Ahh awesome that should help.

I found a similar article last night (slightly different coding approach though), but this seems to be the basic idea I am looking for.

Unfortunately I can't really get started until I have at least basic site administration up, because that's the point where the cache will be created/updated.

Seen as I may be running a php/mysql driven browser game in the future, it can really help if small places like news and such aren't killing the server or database tongue.gif.
Go to the top of the page
 
+Quote Post
matthewk
post May 30 2007, 05:35 PM
Post #4


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 47
Joined: 24-May 07
Member No.: 22,128



Awesome man! thanks for the URL. This is a new idea to me to cache the MySQL queries. I will definitely implement it or give it a shot on my project, because I am using a lot of queries. I want to save as much bandwidth and make it as quick for the user as possible.
Go to the top of the page
 
+Quote Post
Chesso
post May 30 2007, 11:53 PM
Post #5


Teh Coder
Group Icon

Group: Members
Posts: 1,053
Joined: 18-April 06
From: Australia
Member No.: 12,833



Hi matt, I have already implemented it for my new site, and it's not too difficult.

On my news page, I basically check if a cache file (news_cache.htm) already exists, if it does not I flush buffer (cause I already was bufferning), re-start buffering, output a new news page based on the normal querying, get the buffer at the end, flush it, then write it to cache file.

From then on it will load from the cache until the cache is removed.

Where I simply delete the cache file, within my administration section if I Add/Edit or Remove any news piece.

Hope that helps!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. MySQL - Trouble With Bulk Insert Statements(3)
  2. MySQL Realtime Replication(4)
  3. Recover Tables From A MySQL .frm File(8)
  4. A Solution For Disabled Right Click On Web Page(20)
  5. Need Help With A PHP - MySQL Registration Script(13)
  6. [PHP + MySQL] Encrypting Data(9)
  7. PHP Tutorial: Form Verification And Simple Validation(12)
  8. How To Increase Your Google Page Rating ?(12)
  9. Choosing A Different Joomla Start Page(5)
  10. MySQL Output Database Question(18)
  11. MySQL, Multiple Tables(24)
  12. PHP & MySQL: Displaying Content From A Given ID(6)
  13. Navcat For MySQL(8)
  14. Qupis : Free Cpanel Web Hosting (one Line Text Ad At Bottom)(10)
  15. Login System Using A Mysql Db(5)
  1. Make It Impossible To View Page Source(11)
  2. Mysql With My Own Server(4)
  3. Mysql Database Management(1)
  4. Mysql Database Entry By Excel Sheets(2)
  5. Can You Link Game Maker With Mysql/php(0)
  6. Mysql On Computer(9)
  7. How To: Display A Members/user List.(3)
  8. Any Website Provide Free Host Mysql Host?(4)
  9. Mysql Multiple Tables(1)
  10. Hidden A Page Url(1)
  11. Hacked By Dumansal(2)
  12. What You Need Before You Can Create A Text-based Game..(5)
  13. Center Update(5)


 



- Lo-Fi Version Time is now: 5th September 2008 - 06:35 AM