473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

php script buffering

pdc
I need a simple buffering method to cache PHP script-files to reduce
the number of db queries. This method should work on a single php
script and not on the whole web-page generated. This because my portal
based on PHP-Nuke uses a big number of scripts used by inclusion and
each script need a refresh time different. For example the online
members list should be refreshed every 10 seconds, the news every 10
minutes and the articles every 10 houres...
The perfect solution should be to add in every script to be buffered a
PHP directive in the first line specifing the expire-time for that
script.
Any idea?

Jul 4 '06 #1
3 1212
pd*@email.it wrote:
I need a simple buffering method to cache PHP script-files to reduce
the number of db queries.
If you want to reduce the db queries cache the query result. You can
see the php adodb cache method : http://adodb.sourceforge.net/

The php adodb will save the query and query result into file...if the
query match at cache...the result will be taken from the cache.

---
http://blog.deshot.com
http://www.deshot.com

Jul 5 '06 #2
Nice, but this means to modify all the scripts accessing database and I
that is a big challange since I have hundreds of scripts...
My idea was quite simple, just buffering the php output with a expire
time variable script by script...

lorento ha scritto:
pd*@email.it wrote:
I need a simple buffering method to cache PHP script-files to reduce
the number of db queries.

If you want to reduce the db queries cache the query result. You can
see the php adodb cache method : http://adodb.sourceforge.net/

The php adodb will save the query and query result into file...if the
query match at cache...the result will be taken from the cache.

---
http://blog.deshot.com
http://www.deshot.com
Jul 5 '06 #3
Bagus wrote:
Nice, but this means to modify all the scripts accessing database and I
that is a big challange since I have hundreds of scripts...
My idea was quite simple, just buffering the php output with a expire
time variable script by script...

lorento ha scritto:
>pd*@email.it wrote:
>>I need a simple buffering method to cache PHP script-files to reduce
the number of db queries.
If you want to reduce the db queries cache the query result. You can
see the php adodb cache method : http://adodb.sourceforge.net/

The php adodb will save the query and query result into file...if the
query match at cache...the result will be taken from the cache.

---
http://blog.deshot.com
http://www.deshot.com

Have a look at Phunami :
http://www.phpgeek.com/pragmacms/ind...ain&cslot_1=11

I haven't used it (yet), but had it tagged for a similar use.
Still.. you will probably still have to edit a number of if not all your
scripts to include this one.

Good luck,
Juliette
Jul 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Sims | last post by:
Hi, I recall a function that would tell me how long it took to generate an output. But for the life of me I cannot remember it. Dow anybody know it? Or do I have to write something myself,...
5
by: steve | last post by:
Hi, In my script (phpnuke), whenever there is access to database, there is this line of code: message_die(GENERAL_ERROR, ’some error msg’, ’’, __LINE__, __FILE__, $sql); Is there a more...
3
by: Ed Brandmark | last post by:
I have a tag of the form <SCRIPT LANGUAGE="JavaScript1.1" SRC="foo.js"..... and was wondering if this delays the loading of my page until that file foo.js downloads. It seems that if I place...
13
by: tshad | last post by:
Is there a way to run a script or function on entry of each page without having to put a call in each page? Periodically, I find something I want to do each time a page is entered and I have to...
4
by: Tom | last post by:
I have a PHP framework that integrates buffering and sessions among other things and I'm having a problem where my script will get reloaded 2 or 3 times before being output to the browser. I...
13
by: wattersmt | last post by:
Hello, I am trying to write a python cgi that calls a script over ssh, the problem is the script takes a very long time to execute so Apache makes the CGI time out and I never see any output. ...
5
by: lionel | last post by:
Hello, This is a simple script I test in a browser (firefox & opera) : echo "test 1<br />" ; sleep(3); echo "test 2<br />" ; I expected to see "test 1" appearing first and then "test 2" 3...
5
by: This | last post by:
I have a pretty basic emailing script that sends a relatively small number (150) of html emails. The emails are compiled, personalised from a mysql db subscribers list, and sent using mail() -...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.