Php/mysql And Manual Page Caching?

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Php/mysql And Manual Page Caching?

Chesso
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!

 

 

 


Reply

TavoxPeru
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,

 

 

 


Reply

Chesso
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.

Reply

matthewk
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.

Reply

Chesso
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!

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : php, mysql, manual, page, caching,

  1. Free Page Rank Checker Tool
    Grab it ! (1)
  2. Small Issues About Mysql Connector/j 5.1
    (2)
    Hi, all, I just downloaded some versions of mysql Connector/J mysql java driver to test some
    stuffs. There is an issue about the lastest version of 5.1.7. It don't work correctly on older
    version of java 1.3.1. But an older version 5.0.x works without any issue. Hmm... anyone have ideas
    about this ? Testing with 5.1.7 CODE C:\org>java -Xverify:none program Exception in thread
    "main" java.lang.NoSuchMethodError         at
    com.mysql.jdbc.ConnectionPropertiesImpl$BooleanConnectionProperty. (ConnectionProper
    tiesImpl.java:73)         at com.mysql.jdbc.Connect....
  3. Question Related To Website
    need Web page solution (5)
    I have some question in mind that need solution so please 1) What is benefit of using header and
    footer tag in our web page ? 2) How we can registered our website on any search engine? 3) Did I use
    animated image without flash in website.? 4) What is the correct way to display web page on center
    in any browser.? if we use css style ? I have little idea off all question answer but i need
    specific help so welcome. Thanks....
  4. Login System
    I want to make a login system using Mysql. I am amateur in these thing (6)
    I want to make a login system using Mysql. I am amateur in these things so please explain in detail
    like spoon feeding. I have already made a database in http://www.sitebooth.com now what type of
    table I should make and and the website or PHP for it . If you think i hav chosen wrong site please
    give any better database hosting site. Please help me Best Regards Pritesh Gupta....
  5. Which Language Is Easy And Secure Today For Web Development
    is PHP MYSQL is easy and Secure ? (2)
    Web development Application now a day using PHP MySQL Mostly as i observed on discussion topics on
    Forums friends switch to PHP MYSqL, Did PHP MYSQL is Easy and Secure for todays environment what
    you are say about this Hacking tracking stolen password are very much popular now a days his website
    hacked by X person so many time comes to news please emphasis on security issue when you go to
    develop any web tools . what is the right way to tight security on PHP what thing i kept in mind
    which logic i use that any one can not hack webtools. when i was use java/j2ee languag....
  6. Mysql Overhead
    (3)
    Sometimes in a table especially if i do alot of things in it i start seeing overhead then a size
    near it? what is overhead? and is it essential to optimize the table to fix it? I know its just a
    press of a button but i'd like to know what happens when i optimize a table. Also when you make
    a new table you can limit the size of VARCHAR to a number, that number would be the number
    characters allowed in that column per entry. I'd like to know how the limit works for texts, is
    it in KB? or number of characters? Cuz i made a messaging system. And i remember reading s....
  7. Center Update
    Make the center of the page change only (5)
    This is going to be a little hard to explain so just let me know whats confusing you. Ok I'm
    making an online game and i will have a banner on top and have all the page links on the left and
    have other options on the right and when ever you click one of these links i want it to open in the
    center of the page and want the rest of the page to look the same. In other words i want the page
    layout the same and what ever page you go to open in the center which will also be in a box/table.
    How could i do this. I know it's possible because I've seen it on many other ....
  8. What You Need Before You Can Create A Text-based Game..
    Using PHP, HTML and MySQL (7)
    Please comment and rate, after you finished reading! /smile.gif" style="vertical-align:middle"
    emoid=":)" border="0" alt="smile.gif" />
    ################################################################# Change log: Aug 22 2008: The
    Tutorial Was Created. V1.0.0 Aug 30 2008: Added XHTML and a small CSS part. Also corrected some
    small things and added this change log. V2.0.0
    ################################################################# OK.. Many people here want to
    create text based games. Many of you ask us here on the forums: "how to create a text-based game....
  9. Hacked By Dumansal
    When clicking on FAQ link at top of page (2)
    Hi. Didn't think I'd bring this up because I was sure that you'd be onto it soon
    enough. However, it's still there after a few days. Clicking the FAQ link in either AstaHost
    or Trap17 results in a message "Hacked by DumansaL" followed by a database error. I did a forum
    search for the phrase just now... apparently nothing had yet been posted about it. Regards - Lancer....
  10. Any Website Provide Free Host Mysql Host?
    (4)
    any website provide free host mysql host? i need it because i am using 000webhost.com now but it
    only provide 2 mysql database... can i know where or how can i get more databases regards....
  11. How To: Display A Members/user List.
    With PHP, Mysql, and HTML. (3)
    Alright, some of you might want to display your User's or Members on your site. Notes: 1.This
    is to fit in with Feelay's register and Log-in scripts you can find in the tutorial section. 2.I
    made this to show the members of my site who is a member and what their ID is. First off, we must
    set up a connection to our MySQL Database. CODE $con =
    mysql_connect("localhost","database_username","database_username_password"); if (!$con)   {
      die('Could not connect: ' . mysql_error());   } What it does: 1.It is starting a PHP
    document. 2.Next it sets....
  12. How To Create A "user Profile" Page.
    No design (easy to add later if you want). (14)
    Hi! It was a long time ago I created a tutorial, so I've decided to create a new one
    /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> This time, I am
    going to teach you, how to create a "user profile page". Lets say I am logged in on my account, and
    want to view someone else account information (in this case, only his username, but you can add more
    things later). Then I'll press on a link, that will take me to his user profile. But before
    you can do that, you will have to create a register script, and a login script. If you d....
  13. How To Create/edit/delete Ftp Accounts With Php
    Help me to create one php page to create FTP user accounts in Unix Ser (2)
    Thanks /cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> ....
  14. Php Tutorial: Making A Shoutbox
    Requirements: PHP, MySQL (12)
    Hi everyone, I'm going to tell you how to make a simple shoutbox using PHP and MySQL. To start
    off, open up mysql in the command line, or phpmyadmin, and create a database called shoutbox. Next,
    enter the following sql into the command line, or the phpmyadmin sql box, while using the shoutbox
    database: CODE create table messages(author varchar(30), message text, time timestamp, mid int
    auto_increment, primary key(mid)); This creates the table we need to store the messages, note the
    "mid" column, this gives each message a seperate id number, we'll see why ....
  15. Centering The Page
    Like MSN.com and some other sites (9)
    Many sites have a ~780px layout because it fits well with a 800x600px resolution monitor. The
    problem is that I want the whole thing centered in the middle of the screen with equal margins at
    the sides. My CSS is at (Gone, this was MY site - 404) http://portal.trap17.com/wdl/styles.css and
    as you would probably guess, my site is at (Gone, this was MY site - 404)
    http://portal.trap17.com/wdl/ It is centered in Gecko (Firefox) browsers, but in Internet Explorer
    it isn't centered. No matter what I use, whether it is a container or centering the and
    elements, it....
  16. Ajax + Php + Sql = Simply Superb! ( With Visitor Tracking )
    A small tutorial to explain integrating php, ajax and MySQL Database (11)
    Hi all.. I'm back with a new small tutorial! Introducation A tutorial to integrate
    Ajax, Php And Database ( Im using MySQL) + Visitor Tracking! Here you can enter values to some
    input fields, and by clicking some enter button, ( or u can call the function on some other event)
    those values will be sent to the database, along with visitor details ( IP Address, Input Value,
    Visitor Agent etc)! Those values will be stored in some database and you can retrieve the same using
    some simple php code and even deleted some rows from those databases! Requiremen....
  17. Qupis : Free Cpanel Web Hosting (one Line Text Ad At Bottom)
    150 MB space, 10000 MB Bandwidth, php, mysql, CPanel (10)
    Hello Members, We are proud to introduce a new member to Xisto group of sites.
    Qupis : Free Web Hosting 150 MB space, 5000 MB Bandwidth, php,
    mysql, CPanel (Latest). Emails, FTP, Addon domains, Parked Domains etc.
    http://www.Qupis.com
    Feel free to add your reviews and comments about it. -AstaHost
    Management ....
  18. Navcat For MySQL
    is Navcat any good? (9)
    Hello all, i ve recently come across NavCat (GUI tool) for MySQL. I have not bought a copy yet, just
    played around with the demo. Has any one used it beore, if so please let me know if its worth
    buying. I already have PhpMyadmin, Just wanna know if NavCat is better than PhpMyAdmin in usibility
    and functionality. Regards....
  19. PHP & MySQL: Displaying Content From A Given ID
    (6)
    Okay so I got this sample link (not working): http://www.acosta.com/joo.asp?id=654 Now suppose
    I have a PHP file that would use MySql in order to get all values in the row where id 654 is found.
    Here's a sample DB: Table: demnyc ______________________________________ | id |
    Name | Age | Email | *----------------------------------------------------* | 1
    | Albert | 17 | no email |
    *----------------------------------------------------* | 2 | YaPow | 888 |
    no email | |__________....
  20. CuteNews: PHP-based Blog System - No MySQL
    (11)
    I don't know if you guys have heard about CuteNews, but I think it's an awesome blogging
    system. If you don't know where to get it or how to set it up, here is a quick run-down.
    Download the zip file (virus free) from http://www.mysharebox.com/dl.php?key=8276639 . 1) Unzip
    the file. 2) Make a folder titled "cutenews". 3) Upload the contents of the cutenews folder into the
    one you've just created. 4) CHMOD the file index.php to 777. 5) CHMOD the folder "data" to 777.
    6) Then CHMOD all the files and folders inside of "data" to 777. 7) Go to http://YO....
  21. Important: Basics Of Using PHP And MySQL
    (10)
    I generally notice confusion with new users to PHP and or MySQL and first of all I believe that
    unlike HTML which is automatically associated with a IE browser in a Microsoft system. HTML is
    automatically rendered with whatever browser is the default browser, be it Internet Expolrer Firefox
    Netscape or any other browser that has been set. PHP is a different matter to view the output of a
    PHP file it must be run on a webserver, and if you do not have one set up on your local PC it simply
    will not work. (Note serverside langauge requies a server) HTML is client side and ....
  22. MySQL Output Database Question
    (18)
    I am new to MySql and have just created a database after using a script. My problem is not the
    script, but what it says about putting it into the output file. I cant figure out the right terms
    to put it in, I keep getting errors. I try using; SELECT*FROM 'database name' WHERE
    'location' but it isnt working. I'm lost with this stuff, I really am. Can someone
    please help me out?....
  23. Choosing A Different Joomla Start Page
    How do I start somewhere other than Home? (5)
    I am trying to set up Joomla on this site and woud like new visitors to start at the "What We
    Sell" page rather than the Homepage. The What We Sell page is less busy and has some nice photos; I
    want them to be able to click on Home to view news and other things. I tried a 301 redirect from
    the .htaccess file to redirect index.html to
    http://mistymanor.astahost.com/index.php?o...id=19&Itemid=36 but this did not work. Visits simply
    went to index.php as normal. Any ideas?....
  24. MySQL For EasyPHP Users
    Does anyone use this program? (5)
    I installed a program called EasyPHP because it was an easy install and I wanted to be able to learn
    php and still be able to down the road learn MySQL. But I can't figure out how to use MySQL.
    Does anyone out there use this program that could tell me alittle about it. Alot of the product
    site is written in a different language, but everything on the program is english so that is good.
    Any help would be appreciated.....
  25. How To Increase Your Google Page Rating ?
    ??? (16)
    Hey. My church website is http://www.cedarvalley.ca (Cedar Valley Mennonite Church) but it's
    not #1 on Google Search--yet it is on Altavista/Yahoo!. How come? And how can I make it so that it
    is? P.S. I have many spellings/variations on the name in the meta tags. Any suggestions?....
  26. [PHP + MySQL] Encrypting Data
    To protect the password of your DB, for example. (11)
    Hi! This is my 2nd code of PHP + MySQL. This code is VERY simple: it encript the data in the MySQL
    DB. Here we go! ------------------------------------------------------------------------ CODE
    $password = "abc"; $new_password = md5($password); echo $new_password; ?> The password "abc"
    was codfied using md5() This will be: 900150983cd24fb0d6963f7d28e17f72 CODE $normal_pass =
    "abc"; $encripted_pass = "900150983cd24fb0d6963f7d28e17f72"; if(md5($normal_pass) ==
    $encripted_pass)   echo "Login Sucessful!"; else   echo "Incorrect password."; ?> This c....
  27. Disable /change The Find In Page Sound In Firefox
    (1)
    How to disable or change the "find in page" sound in Mozilla FireFox Just as you know,by pressing
    Ctrl-F, the find bar appears at the bottom of the Firefox Window, you can disable or change the
    "find in page" sound. 1- run Mozilla FireFox and type “about:config” (without quotes ) in the
    address bar and press ENTER to open Mozilla FireFox configuration. 2- Type” typeahead” (without
    quotes ) in the filter field to filter options 3- To disable this ability, double-click on “
    accessibility.typeaheadfind.enablesound “option to disable it. The line will turn bold , it mean....
  28. A Solution For Disabled Right Click On Web Page
    (20)
    a solution for disabled right click on web pages!!?? /blink.gif' border='0'
    style='vertical-align:middle' alt='blink.gif' /> Webmasters may disable right click on web pages
    by Java Script for copyright purposes. follow below ways to right click: 1- Hold down middle button
    and press right button. 2- Hold down left button and press right button. 3- Press Esc or Enter and
    right button contemporaneously. 4- Press specific button on keyboard. Be successful /cool.gif'
    border='0' style='vertical-align:middle' alt='cool.gif' /> ....
  29. How To Increase Windows Shutdown Speed
    when you enabled “clear Page File at shu (40)
    How to increase Windows shutdown speed when you enabled “clear Page File at shutdown”? /blink.gif'
    border='0' style='vertical-align:middle' alt='blink.gif' /> Note that making incorrectly changes
    to the registry may damage your system; please back up any valued data on your computer. 1) Go to
    Start menu > Run > and type regedit and click OK. 2) Find following address: HKEY_LOCAL_MACHINE \
    SYSTEM \ CurrentControlSet \ Control \Session Manager \ Memory Management 3) In right side right
    click on “ClearPageFileAtShutdown”, select Modify and make value of “1”, and Exit ....
  30. MySQL Realtime Replication
    how to replicate mysql in realtime (4)
    i dont know if this might be useful to ppl here, but this is a very good knowledge for serious
    siteadmins. while i was digging for mysql backup techniques, i've found that mysql is able to
    do realtime replication. the idea is that there are master server and slave server. both are having
    the same version of mysql installed. the data flows; Master >copy> Slave ( in realtime!)
    you'll never have to manually copy the database file of wasting your time to manually use the
    mysqldump command. here are the links; http://dev.mysql.com/doc/mysql/en/Replication_HOWTO.h....

    1. Looking for php, mysql, manual, page, caching,






*SIMILAR VIDEOS*
Searching Video's for php, mysql, manual, page, caching,
Similar
Free Page Rank Checker Tool - Grab it !
Small Issues About Mysql Connector/j 5.1
Question Related To Website - need Web page solution
Login System - I want to make a login system using Mysql. I am amateur in these thing
Which Language Is Easy And Secure Today For Web Development - is PHP MYSQL is easy and Secure ?
Mysql Overhead
Center Update - Make the center of the page change only
What You Need Before You Can Create A Text-based Game.. - Using PHP, HTML and MySQL
Hacked By Dumansal - When clicking on FAQ link at top of page
Any Website Provide Free Host Mysql Host?
How To: Display A Members/user List. - With PHP, Mysql, and HTML.
How To Create A "user Profile" Page. - No design (easy to add later if you want).
How To Create/edit/delete Ftp Accounts With Php - Help me to create one php page to create FTP user accounts in Unix Ser
Php Tutorial: Making A Shoutbox - Requirements: PHP, MySQL
Centering The Page - Like MSN.com and some other sites
Ajax + Php + Sql = Simply Superb! ( With Visitor Tracking ) - A small tutorial to explain integrating php, ajax and MySQL Database
Qupis : Free Cpanel Web Hosting (one Line Text Ad At Bottom) - 150 MB space, 10000 MB Bandwidth, php, mysql, CPanel
Navcat For MySQL - is Navcat any good?
PHP & MySQL: Displaying Content From A Given ID
CuteNews: PHP-based Blog System - No MySQL
Important: Basics Of Using PHP And MySQL
MySQL Output Database Question
Choosing A Different Joomla Start Page - How do I start somewhere other than Home?
MySQL For EasyPHP Users - Does anyone use this program?
How To Increase Your Google Page Rating ? - ???
[PHP + MySQL] Encrypting Data - To protect the password of your DB, for example.
Disable /change The Find In Page Sound In Firefox
A Solution For Disabled Right Click On Web Page
How To Increase Windows Shutdown Speed - when you enabled “clear Page File at shu
MySQL Realtime Replication - how to replicate mysql in realtime
advertisement




Php/mysql And Manual Page Caching?