Re: [PHP] caching problem

2011-06-28 Thread Stuart Dallas
On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
 On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
 cont...@nileshgr.com (mailto:cont...@nileshgr.com)wrote:
 
  On 06/28/2011 10:56 AM, Fatih P. wrote:
   Hi guys,
   
   the code files are being cached. and modifications in methods are skipped
   and not executed. is there any parameter that i can pass it from ini
  file?
   this has been so annoying for me. restarting apache, windows, etc does
  not
   even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
   any ideas how to avoid this situation? thanks
   
   Fatih
  
  It seems you have a wrongly configured opcode cache runnning about which
  you're not aware of.
  
  --
  Regards,
  Nilesh Govindarajan
  @nileshgr on twitter/identica
 basically using default configuration, have not changed anything except the
 path for extensions in php.ini.
 and there is nothing installed/configured to cache anything.

Since restarting Apache does not help, the problem is obviously outside the web 
server. There are two possibilities I can think of...

* Browser caching

* Proxy caching

See if clearing your browser cache helps. If not then you probably have a proxy 
between you and the server that's caching the content.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


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



RE: [PHP] caching problem

2011-06-28 Thread admin
If the issue is a caching proxy or browser caching I suggest you look into 
controlling the page caching header.

You can expire the header.

// calc an offset of 24 hours
 $offset = 3600 * 24;
 // calc the string in GMT not localtime and add the offset
 $expire = Expires:  . gmdate(D, d M Y H:i:s, time() + $offset) .  GMT;
 //output the HTTP header
 Header($expire);

Just a thought.

Richard L. Buskirk


-Original Message-
From: Stuart Dallas [mailto:stu...@3ft9.com] 
Sent: Tuesday, June 28, 2011 7:53 AM
To: Fatih P.
Cc: php-general@lists.php.net
Subject: Re: [PHP] caching problem

On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
 On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
 cont...@nileshgr.com (mailto:cont...@nileshgr.com)wrote:
 
  On 06/28/2011 10:56 AM, Fatih P. wrote:
   Hi guys,
   
   the code files are being cached. and modifications in methods are skipped
   and not executed. is there any parameter that i can pass it from ini
  file?
   this has been so annoying for me. restarting apache, windows, etc does
  not
   even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
   any ideas how to avoid this situation? thanks
   
   Fatih
  
  It seems you have a wrongly configured opcode cache runnning about which
  you're not aware of.
  
  --
  Regards,
  Nilesh Govindarajan
  @nileshgr on twitter/identica
 basically using default configuration, have not changed anything except the
 path for extensions in php.ini.
 and there is nothing installed/configured to cache anything.

Since restarting Apache does not help, the problem is obviously outside the web 
server. There are two possibilities I can think of...

* Browser caching

* Proxy caching

See if clearing your browser cache helps. If not then you probably have a proxy 
between you and the server that's caching the content.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


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


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



Re: [PHP] caching problem

2011-06-28 Thread Stuart Dallas
On Tue, Jun 28, 2011 at 1:51 PM, Fatih P. fatihpirist...@gmail.com wrote:



 On Tue, Jun 28, 2011 at 1:52 PM, Stuart Dallas stu...@3ft9.com wrote:

 On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
  On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
  cont...@nileshgr.com (mailto:cont...@nileshgr.com)wrote:
 
   On 06/28/2011 10:56 AM, Fatih P. wrote:
Hi guys,
   
the code files are being cached. and modifications in methods are
 skipped
and not executed. is there any parameter that i can pass it from ini
   file?
this has been so annoying for me. restarting apache, windows, etc
 does
   not
even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
any ideas how to avoid this situation? thanks
   
Fatih
  
   It seems you have a wrongly configured opcode cache runnning about
 which
   you're not aware of.
  
   --
   Regards,
   Nilesh Govindarajan
   @nileshgr on twitter/identica
  basically using default configuration, have not changed anything except
 the
  path for extensions in php.ini.
  and there is nothing installed/configured to cache anything.

 Since restarting Apache does not help, the problem is obviously outside
 the web server. There are two possibilities I can think of...

 * Browser caching

 * Proxy caching

 See if clearing your browser cache helps. If not then you probably have a
 proxy between you and the server that's caching the content.

 -Stuart

 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/


 This is not proxy or browser caching. browser does not receive php code. it
 gets output of php code.


Well thanks, cos I only started doing this whole webby programmy developy
technobabble thing yesterday and I'm still learning the basics!*

How do you know that modifications in methods are skipped and not
executed? By looking at the output shown in your browser? The output that
could be cached by proxies and/or your browser?

Or are you running them on the command line, in which case some sort of
opcode cache is probably the culprit, or you're not running the code you
think you are.

-Stuart

*sarcasm!

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


RE: [PHP] caching problem

2011-06-28 Thread admin
Faith,

I actually did read from the beginning of the message.

That does not make sense.
PHP files are cached intentionally, the system does not Cache PHP on its own.
Sounds to me like you have an issue re-declaring an object or calling the right 
script/path/class/method something.


I have never heard of PHP being cached unless it was intentionally cached it. 
Thank god for security reason!
HTML output?? Sure all the time helps the browser load the content faster.

I have a real issue with who ever told you that PHP is being cached, because if 
that was the case there is SERIOUS security hole in your PHP.
I am doubting that.

I have cached PHP, it can be done. 

Are you using APC(Alternative PHP Cache)???

I would not suggest it with complex scripting using classes and methods they 
are the whole reason NOT to cache.


That’s just my opinion.

Richard L. Buskirk

-Original Message-
From: Stuart Dallas [mailto:stu...@3ft9.com] 
Sent: Tuesday, June 28, 2011 9:18 AM
To: Fatih P.
Cc: PHP General
Subject: Re: [PHP] caching problem

On Tue, Jun 28, 2011 at 1:51 PM, Fatih P. fatihpirist...@gmail.com wrote:



 On Tue, Jun 28, 2011 at 1:52 PM, Stuart Dallas stu...@3ft9.com wrote:

 On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
  On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
  cont...@nileshgr.com (mailto:cont...@nileshgr.com)wrote:
 
   On 06/28/2011 10:56 AM, Fatih P. wrote:
Hi guys,
   
the code files are being cached. and modifications in methods are
 skipped
and not executed. is there any parameter that i can pass it from ini
   file?
this has been so annoying for me. restarting apache, windows, etc
 does
   not
even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
any ideas how to avoid this situation? thanks
   
Fatih
  
   It seems you have a wrongly configured opcode cache runnning about
 which
   you're not aware of.
  
   --
   Regards,
   Nilesh Govindarajan
   @nileshgr on twitter/identica
  basically using default configuration, have not changed anything except
 the
  path for extensions in php.ini.
  and there is nothing installed/configured to cache anything.

 Since restarting Apache does not help, the problem is obviously outside
 the web server. There are two possibilities I can think of...

 * Browser caching

 * Proxy caching

 See if clearing your browser cache helps. If not then you probably have a
 proxy between you and the server that's caching the content.

 -Stuart

 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/


 This is not proxy or browser caching. browser does not receive php code. it
 gets output of php code.


Well thanks, cos I only started doing this whole webby programmy developy
technobabble thing yesterday and I'm still learning the basics!*

How do you know that modifications in methods are skipped and not
executed? By looking at the output shown in your browser? The output that
could be cached by proxies and/or your browser?

Or are you running them on the command line, in which case some sort of
opcode cache is probably the culprit, or you're not running the code you
think you are.

-Stuart

*sarcasm!

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


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



Re: [PHP] caching problem

2011-06-28 Thread Fatih P.
On Tue, Jun 28, 2011 at 5:12 PM, ad...@buskirkgraphics.com wrote:

 Faith,

 I actually did read from the beginning of the message.

 That does not make sense.
 PHP files are cached intentionally, the system does not Cache PHP on its
 own.
 Sounds to me like you have an issue re-declaring an object or calling the
 right script/path/class/method something.


 I have never heard of PHP being cached unless it was intentionally cached
 it. Thank god for security reason!
 HTML output?? Sure all the time helps the browser load the content faster.

 I have a real issue with who ever told you that PHP is being cached,
 because if that was the case there is SERIOUS security hole in your PHP.
 I am doubting that.

 I have cached PHP, it can be done.

 Are you using APC(Alternative PHP Cache)???

 I would not suggest it with complex scripting using classes and methods
 they are the whole reason NOT to cache.


 That’s just my opinion.

 Richard L. Buskirk


Well, seems you didn't read it carefully even to write my name correctly. if
this is an issue with PHP then it is an
issue with PHP. AsI said I am using pre-compiled binaries with default
settings. also mentioned no caching is
enabled to cache anything.  And NO i am not using APC either or something
else!!!


Re: [PHP] caching problem

2011-06-28 Thread Stuart Dallas
On Tue, Jun 28, 2011 at 4:23 PM, Fatih P. fatihpirist...@gmail.com wrote:

 On Tue, Jun 28, 2011 at 5:12 PM, ad...@buskirkgraphics.com wrote:

  Faith,
 
  I actually did read from the beginning of the message.
 
  That does not make sense.
  PHP files are cached intentionally, the system does not Cache PHP on its
  own.
  Sounds to me like you have an issue re-declaring an object or calling the
  right script/path/class/method something.
 
 
  I have never heard of PHP being cached unless it was intentionally cached
  it. Thank god for security reason!
  HTML output?? Sure all the time helps the browser load the content
 faster.
 
  I have a real issue with who ever told you that PHP is being cached,
  because if that was the case there is SERIOUS security hole in your PHP.
  I am doubting that.
 
  I have cached PHP, it can be done.
 
  Are you using APC(Alternative PHP Cache)???
 
  I would not suggest it with complex scripting using classes and methods
  they are the whole reason NOT to cache.
 
 
  That’s just my opinion.
 
  Richard L. Buskirk
 
 
 Well, seems you didn't read it carefully even to write my name correctly.
 if
 this is an issue with PHP then it is an
 issue with PHP. AsI said I am using pre-compiled binaries with default
 settings. also mentioned no caching is
 enabled to cache anything.  And NO i am not using APC either or something
 else!!!



Fatih, please explain what you mean by the code files are being cached. and
modifications in methods are skipped
and not executed. How are you getting the modified files onto the server,
and how are you running the scripts? Are you working directly on the server,
or are you uploading the files to the server via FTP, SCP or some other
mechanism?

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


Re: [PHP] caching problem

2011-06-28 Thread Fatih P.
On Tue, Jun 28, 2011 at 5:30 PM, Stuart Dallas stu...@3ft9.com wrote:

 On Tue, Jun 28, 2011 at 4:23 PM, Fatih P. fatihpirist...@gmail.comwrote:

 On Tue, Jun 28, 2011 at 5:12 PM, ad...@buskirkgraphics.com wrote:

  Faith,
 
  I actually did read from the beginning of the message.
 
  That does not make sense.
  PHP files are cached intentionally, the system does not Cache PHP on its
  own.
  Sounds to me like you have an issue re-declaring an object or calling
 the
  right script/path/class/method something.
 
 
  I have never heard of PHP being cached unless it was intentionally
 cached
  it. Thank god for security reason!
  HTML output?? Sure all the time helps the browser load the content
 faster.
 
  I have a real issue with who ever told you that PHP is being cached,
  because if that was the case there is SERIOUS security hole in your PHP.
  I am doubting that.
 
  I have cached PHP, it can be done.
 
  Are you using APC(Alternative PHP Cache)???
 
  I would not suggest it with complex scripting using classes and methods
  they are the whole reason NOT to cache.
 
 
  That’s just my opinion.
 
  Richard L. Buskirk
 
 
 Well, seems you didn't read it carefully even to write my name correctly.
 if
 this is an issue with PHP then it is an
 issue with PHP. AsI said I am using pre-compiled binaries with default
 settings. also mentioned no caching is
 enabled to cache anything.  And NO i am not using APC either or something
 else!!!



 Fatih, please explain what you mean by the code files are being cached.
 and modifications in methods are skipped
 and not executed. How are you getting the modified files onto the server,
 and how are you running the scripts? Are you working directly on the server,
 or are you uploading the files to the server via FTP, SCP or some other
 mechanism?

 -Stuart

 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/


OK, this is a development machine, everything is running on it. nothing is
being uploaded  through ftp, scp or something else.
all kind of content caching is disabled.

and what I mean by the code files are being cached is: after the
modifications, i do get the result which was produced before modification.
which shows
that the file is not being interpreted by php. how i get to this point that
I see errors after restarting the machine which were not there during coding
or when
i dump an object it doesn't show up anything other than previous content.

to recover this situation,  either I have to restart httpd which sometimes
does work or when it gets more problematic,
i have to crush httpd / php on start. and only having this problem on
windows machines.

sounds funny to most of you but it is happening


Re: [PHP] caching problem

2011-06-28 Thread Stuart Dallas
On Tue, Jun 28, 2011 at 5:12 PM, Fatih P. fatihpirist...@gmail.com wrote:

 On Tue, Jun 28, 2011 at 5:30 PM, Stuart Dallas stu...@3ft9.com wrote:

 Fatih, please explain what you mean by the code files are being cached.
 and modifications in methods are skipped
 and not executed. How are you getting the modified files onto the server,
 and how are you running the scripts? Are you working directly on the server,
 or are you uploading the files to the server via FTP, SCP or some other
 mechanism?

 OK, this is a development machine, everything is running on it. nothing is
 being uploaded  through ftp, scp or something else.
 all kind of content caching is disabled.

 and what I mean by the code files are being cached is: after the
 modifications, i do get the result which was produced before modification.
 which shows
 that the file is not being interpreted by php. how i get to this point that
 I see errors after restarting the machine which were not there during coding
 or when
 i dump an object it doesn't show up anything other than previous content.

 to recover this situation,  either I have to restart httpd which sometimes
 does work or when it gets more problematic,
 i have to crush httpd / php on start. and only having this problem on
 windows machines.

 sounds funny to most of you but it is happening


I'm sure it is happening, I don't doubt that, but there's probably a very
simple explanation.

What browser are you using? Certain older browsers such as IE6 have their
own ideas about whether pages should be cached or not. You can usually
bypass the browser cache by holding control and/or shift while clicking on
the refresh button. Try that next time this happens.

Other possibilities include filesystem issues, such that the OS is not
seeing that the file has been changed - there are levels of caching on
modern operating systems that most people, quite correctly, are not aware
of. The likelihood of this being the cause is miniscule.

If you're absolutely certain that you are not using any opcode caching (you
mentioned that you are using pre-compiled binaries, and it's possible they
include APC or similar by default), then I have no idea what's going on
beyond what I and others have already suggested.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


RE: [PHP] caching problem

2011-06-28 Thread admin
Fatih,
I am sorry spell check auto corrected your name, I was not changing 
your name on purpose.
It was not my intension to piss you off. 

I understand your frustration, trust me. 
I am running 5.3.6 on Windows Server 2008 R2 IIS, I am running massive class 
based methods in my own framework.
I am trying to help you narrow down the issue. I never blame PHP first because 
in my trouble shooting steps, I never get to PHP before I find the issue.

Segmentation Faults: that prevent the php script from completing locking up 
resources and causing a nightmare chain of events. It dumps the process at the 
fail point can look like it is a PHP thing but it is not. This can explain 
sometimes it works and sometimes it does not.

This can be caused by a host of reasons:
Buffer Overflow,
Attempting to access memory the program does not own. (This also points to 
Storage Violations)
Using uninitialized pointers,
Dereferencing Null pointers

Again suggestions please do not take offense.


Richard L. Buskirk


-Original Message-
From: Fatih P. [mailto:fatihpirist...@gmail.com] 
Sent: Tuesday, June 28, 2011 12:13 PM
To: Stuart Dallas
Cc: ad...@buskirkgraphics.com; PHP General
Subject: Re: [PHP] caching problem

On Tue, Jun 28, 2011 at 5:30 PM, Stuart Dallas stu...@3ft9.com wrote:

 On Tue, Jun 28, 2011 at 4:23 PM, Fatih P. fatihpirist...@gmail.comwrote:

 On Tue, Jun 28, 2011 at 5:12 PM, ad...@buskirkgraphics.com wrote:

  Faith,
 
  I actually did read from the beginning of the message.
 
  That does not make sense.
  PHP files are cached intentionally, the system does not Cache PHP on its
  own.
  Sounds to me like you have an issue re-declaring an object or calling
 the
  right script/path/class/method something.
 
 
  I have never heard of PHP being cached unless it was intentionally
 cached
  it. Thank god for security reason!
  HTML output?? Sure all the time helps the browser load the content
 faster.
 
  I have a real issue with who ever told you that PHP is being cached,
  because if that was the case there is SERIOUS security hole in your PHP.
  I am doubting that.
 
  I have cached PHP, it can be done.
 
  Are you using APC(Alternative PHP Cache)???
 
  I would not suggest it with complex scripting using classes and methods
  they are the whole reason NOT to cache.
 
 
  That’s just my opinion.
 
  Richard L. Buskirk
 
 
 Well, seems you didn't read it carefully even to write my name correctly.
 if
 this is an issue with PHP then it is an
 issue with PHP. AsI said I am using pre-compiled binaries with default
 settings. also mentioned no caching is
 enabled to cache anything.  And NO i am not using APC either or something
 else!!!



 Fatih, please explain what you mean by the code files are being cached.
 and modifications in methods are skipped
 and not executed. How are you getting the modified files onto the server,
 and how are you running the scripts? Are you working directly on the server,
 or are you uploading the files to the server via FTP, SCP or some other
 mechanism?

 -Stuart

 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/


OK, this is a development machine, everything is running on it. nothing is
being uploaded  through ftp, scp or something else.
all kind of content caching is disabled.

and what I mean by the code files are being cached is: after the
modifications, i do get the result which was produced before modification.
which shows
that the file is not being interpreted by php. how i get to this point that
I see errors after restarting the machine which were not there during coding
or when
i dump an object it doesn't show up anything other than previous content.

to recover this situation,  either I have to restart httpd which sometimes
does work or when it gets more problematic,
i have to crush httpd / php on start. and only having this problem on
windows machines.

sounds funny to most of you but it is happening


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



Re: [PHP] caching problem

2011-06-28 Thread Steve Staples
On Tue, 2011-06-28 at 17:34 +0100, Stuart Dallas wrote:
 On Tue, Jun 28, 2011 at 5:12 PM, Fatih P. fatihpirist...@gmail.com wrote:
 
  On Tue, Jun 28, 2011 at 5:30 PM, Stuart Dallas stu...@3ft9.com wrote:
 
  Fatih, please explain what you mean by the code files are being cached.
  and modifications in methods are skipped
  and not executed. How are you getting the modified files onto the server,
  and how are you running the scripts? Are you working directly on the 
  server,
  or are you uploading the files to the server via FTP, SCP or some other
  mechanism?
 
  OK, this is a development machine, everything is running on it. nothing is
  being uploaded  through ftp, scp or something else.
  all kind of content caching is disabled.
 
  and what I mean by the code files are being cached is: after the
  modifications, i do get the result which was produced before modification.
  which shows
  that the file is not being interpreted by php. how i get to this point that
  I see errors after restarting the machine which were not there during coding
  or when
  i dump an object it doesn't show up anything other than previous content.
 
  to recover this situation,  either I have to restart httpd which sometimes
  does work or when it gets more problematic,
  i have to crush httpd / php on start. and only having this problem on
  windows machines.
 
  sounds funny to most of you but it is happening
 
 
 I'm sure it is happening, I don't doubt that, but there's probably a very
 simple explanation.
 
 What browser are you using? Certain older browsers such as IE6 have their
 own ideas about whether pages should be cached or not. You can usually
 bypass the browser cache by holding control and/or shift while clicking on
 the refresh button. Try that next time this happens.
 
 Other possibilities include filesystem issues, such that the OS is not
 seeing that the file has been changed - there are levels of caching on
 modern operating systems that most people, quite correctly, are not aware
 of. The likelihood of this being the cause is miniscule.
 
 If you're absolutely certain that you are not using any opcode caching (you
 mentioned that you are using pre-compiled binaries, and it's possible they
 include APC or similar by default), then I have no idea what's going on
 beyond what I and others have already suggested.
 
 -Stuart
 


maybe, you're updating the wrong files?   I've done that a few times,
where the files i THOUGHT it was using, ended up being in the wrong
folder (or apache was pointing to a different folder... kinda one in the
same).

just an alternate spin on it... 

Steve


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



Re: [PHP] caching problem

2011-06-28 Thread Fatih P.
On Tue, Jun 28, 2011 at 6:39 PM, ad...@buskirkgraphics.com wrote:

 Fatih,
I am sorry spell check auto corrected your name, I was not changing
 your name on purpose.
 It was not my intension to piss you off.

 I understand your frustration, trust me.
 I am running 5.3.6 on Windows Server 2008 R2 IIS, I am running massive
 class based methods in my own framework.
 I am trying to help you narrow down the issue. I never blame PHP first
 because in my trouble shooting steps, I never get to PHP before I find the
 issue.

 Segmentation Faults: that prevent the php script from completing locking up
 resources and causing a nightmare chain of events. It dumps the process at
 the fail point can look like it is a PHP thing but it is not. This can
 explain sometimes it works and sometimes it does not.

 This can be caused by a host of reasons:
 Buffer Overflow,
 Attempting to access memory the program does not own. (This also points to
 Storage Violations)
 Using uninitialized pointers,
 Dereferencing Null pointers

 Again suggestions please do not take offense.


 Richard L. Buskirk


already here to ask for suggestions not to take offense. Anyway, I will
re-check these points you have mentioned.

thanks.


Re: [PHP] caching problem

2011-06-28 Thread Micky Hulse
OP:

Can we see the methods in question?

Have you tried running the code on a different server/host?

Have you added any scaffolding to your methods in order to test your
caching theory? This would be the first thing I would try (i.e. create
random number (or whatever), concat with variable vals generated via
method, other.)

Sent from my iPhone

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



Re: [PHP] caching problem

2011-06-28 Thread Stuart Dallas
On Tue, Jun 28, 2011 at 5:53 PM, Fatih P. fatihpirist...@gmail.com wrote:



 On Tue, Jun 28, 2011 at 6:34 PM, Stuart Dallas stu...@3ft9.com wrote:

 On Tue, Jun 28, 2011 at 5:12 PM, Fatih P. fatihpirist...@gmail.comwrote:

 On Tue, Jun 28, 2011 at 5:30 PM, Stuart Dallas stu...@3ft9.com wrote:

 Fatih, please explain what you mean by the code files are being
 cached. and modifications in methods are skipped
  and not executed. How are you getting the modified files onto the
 server, and how are you running the scripts? Are you working directly on 
 the
 server, or are you uploading the files to the server via FTP, SCP or some
 other mechanism?

 OK, this is a development machine, everything is running on it. nothing
 is being uploaded  through ftp, scp or something else.
 all kind of content caching is disabled.

 and what I mean by the code files are being cached is: after the
 modifications, i do get the result which was produced before modification.
 which shows
 that the file is not being interpreted by php. how i get to this point
 that I see errors after restarting the machine which were not there during
 coding or when
 i dump an object it doesn't show up anything other than previous content.

 to recover this situation,  either I have to restart httpd which
 sometimes does work or when it gets more problematic,
 i have to crush httpd / php on start. and only having this problem on
 windows machines.

 sounds funny to most of you but it is happening


 I'm sure it is happening, I don't doubt that, but there's probably a very
 simple explanation.

 What browser are you using? Certain older browsers such as IE6 have their
 own ideas about whether pages should be cached or not. You can usually
 bypass the browser cache by holding control and/or shift while clicking on
 the refresh button. Try that next time this happens.

 Other possibilities include filesystem issues, such that the OS is not
 seeing that the file has been changed - there are levels of caching on
 modern operating systems that most people, quite correctly, are not aware
 of. The likelihood of this being the cause is miniscule.

 If you're absolutely certain that you are not using any opcode caching
 (you mentioned that you are using pre-compiled binaries, and it's possible
 they include APC or similar by default), then I have no idea what's going on
 beyond what I and others have already suggested.

 using FF3,5 and IE7 as browser.


Those browsers should be fine, but forcing a reload (the control/shift +
refresh) is always worth trying.

Maybe I should compile php myself disabling things i dont need and see it
 will make any difference.


You can see what's in your PHP build by creating a script that just contains
the following..

?php phpinfo(); ?

Run that and check the output. If you got the binary from php.net then
chances are that you don't have any opcode caching modules in there.

It's also worth doing a variation on Micky's suggestion - when I want to
make sure a script has actually been executed rather than cached data being
served I put a call to echo date('r'); in an appropriate place. That way the
script output will display the current date and time which should change
with each request.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


[PHP] caching problem

2011-06-27 Thread Fatih P.
Hi guys,

the code files are being cached. and modifications in methods are skipped
and not executed. is there any parameter that i can pass it from ini file?
this has been so annoying for me. restarting apache, windows, etc does not
even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
any ideas how to avoid this situation? thanks

Fatih


Re: [PHP] caching problem

2011-06-27 Thread Nilesh Govindarajan
On 06/28/2011 10:56 AM, Fatih P. wrote:
 Hi guys,

 the code files are being cached. and modifications in methods are skipped
 and not executed. is there any parameter that i can pass it from ini file?
 this has been so annoying for me. restarting apache, windows, etc does not
 even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
 any ideas how to avoid this situation? thanks

 Fatih


It seems you have a wrongly configured opcode cache runnning about which
you're not aware of.

-- 
Regards,
Nilesh Govindarajan
@nileshgr on twitter/identica


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



Re: [PHP] caching problem

2011-06-27 Thread Fatih P.
On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
cont...@nileshgr.comwrote:

 On 06/28/2011 10:56 AM, Fatih P. wrote:
  Hi guys,
 
  the code files are being cached. and modifications in methods are skipped
  and not executed. is there any parameter that i can pass it from ini
 file?
  this has been so annoying for me. restarting apache, windows, etc does
 not
  even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
  any ideas how to avoid this situation? thanks
 
  Fatih
 

 It seems you have a wrongly configured opcode cache runnning about which
 you're not aware of.

 --
 Regards,
 Nilesh Govindarajan
 @nileshgr on twitter/identica


basically using default configuration, have not changed anything except the
path for extensions in php.ini.
and there is nothing installed/configured to cache anything.


Re: [PHP] Internal PHP caching methodology

2009-07-20 Thread Eric Butera
On Sat, Jul 18, 2009 at 7:14 AM, Daniel Kolbokolb0...@umn.edu wrote:
 Daniel Kolbo wrote:
 Eric Butera wrote:
 On Thu, Jul 16, 2009 at 5:50 PM, Daniel Kolbokolb0...@umn.edu wrote:
 Hello,

 Call me a dreamer...but I got to ask.

 Is there any software for helping speed up PHP by utilizing internal PHP
 caching?

 I am not talking about the external php cache/header control.  Smarty
 caching doesn't give me the control I need either.

 I would like to cache to a finer level than page by page, but rather on
 a module by module basis.  Each of my pages contains a subset of
 modules.  The content of these modules changes based upon certain
 criteria (link, time, session data, but is sometimes static across the
 site).  I would like to be able to cache individual modules
 (preferably based upon frequency and time to generate).

 I am trying to develop a way to do this, but I have to think a brighter
 mind has come before me and hopefully arrived at a solution.

 As always any help/thoughts are much appreciated, except for that one
 guy's comments (you all know who I am talking) ~ jk ;)

 Thanks,
 `

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


 Have you actually profiled your code to see where the pain points are
 vs saying 'module?'  Are you also running an opcode cache?  From there
 you can use data, block, or full page caching.  Finally you can figure
 out if you want to store it in flat files or memory.  I'd start by
 knowing what is actually the slow part using Xdebug and nail a few
 down.

 There is no end all solution.  Some pages really don't have a lot
 going on and are hardly updated so full page is fine.  Others might
 have something that is hard to generate on a sidebar, so block caching
 would be more suitable for that.  As previously mentioned, Zend_Cache
 is up to the task.  There is also a PEAR package called Cache_Lite
 which would work to if you're interested in file based caching.


 So dreams do come true...

 Thank you for the wonderful insight.  I've been reading about the
 memcached and Xdebug and Zend_Cache.  I've got lots to learn, but it is
 exactly the type of material i was trying to find.

 I am not currently running an opcode cache.  I may be doing premature
 optimization, but i want to design the entire system intelligently from
 the get go rather than having to rebuild later.  you know 'work smarter
 not harder'

 Is it possible to run xdebug on a virtual host server on which i do not
 have shell access?  I can modify php.ini via cgi, but I don't know if
 i'd be able to view the results of xdebug on the machine.  Your opinion
 would be appreciated.

 Thanks so much, i feel like i've just been shown a whole new world.
 dK
 `

 I still have to (fully) rtfm.  But i was wondering if the following
 scenario(s) is(are) possible.

 -Does memcached store the same data under different keys in the same spot?

 From my reading so far, i do not think so.
 My understanding is that currently memcached goes like as follows:
 key-key_hash-server-data_value
 but this approach could conceivably store the same data_value under
 different keys (thus consuming unneeded memory)

 What i'd like it to do is the following:
 key-key_hash-server-data_hash-server-data_value

 That is, each key has the data_hash as its value.  Then one uses this
 data_hash as the new key which has the data_value as its value.
 This way the only data that is replicated would be the relatively small
 data_hash, but the (larger) data itself would not be replicated.

 This would allow for the user to use different keys to access the same
 data.  This would be needed when seemingly different keys happen to
 share the same data, but would be too costly to recognize, predict, and
 accommodate such associations

 This doubles the number of calls to the server, but could conceivable
 save a great deal of memory for more cached objects.  What would be even
 slicker is if the programmer could use either approach within the same
 script.  For example, if the programmer new for (almost) certain that a
 certain key would never have the same data signature as any other key,
 she could then use the original method and save on the overhead of
 storing key_hash to data_hashes pairs.

 Also, I really like the idea behind zend_cache that I can use memcache/d
 as the backend.  That's pretty modular!

 I have three direct questions:
 1) Is the above approach wise or have i violated some basic caching
 principle?

 2) Is the php memcache/memcached class extendable (so that I can
 implement 1 above)?

 3) If 2) is yes, can I use this extendable class as the backend for
 zend_cache?

 Thanks,
 dK
 `



The fact you said you haven't used Xdebug or have an opcode cache
means you're starting from the wrong end.  I'm pretty sure using
Zend_Cache with a flatfile backend would be more than adequate for
your needs.

As for your questions, if you think that is the way to use it that
would

Re: [PHP] Internal PHP caching methodology

2009-07-18 Thread Daniel Kolbo
Daniel Kolbo wrote:
 Eric Butera wrote:
 On Thu, Jul 16, 2009 at 5:50 PM, Daniel Kolbokolb0...@umn.edu wrote:
 Hello,

 Call me a dreamer...but I got to ask.

 Is there any software for helping speed up PHP by utilizing internal PHP
 caching?

 I am not talking about the external php cache/header control.  Smarty
 caching doesn't give me the control I need either.

 I would like to cache to a finer level than page by page, but rather on
 a module by module basis.  Each of my pages contains a subset of
 modules.  The content of these modules changes based upon certain
 criteria (link, time, session data, but is sometimes static across the
 site).  I would like to be able to cache individual modules
 (preferably based upon frequency and time to generate).

 I am trying to develop a way to do this, but I have to think a brighter
 mind has come before me and hopefully arrived at a solution.

 As always any help/thoughts are much appreciated, except for that one
 guy's comments (you all know who I am talking) ~ jk ;)

 Thanks,
 `

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


 Have you actually profiled your code to see where the pain points are
 vs saying 'module?'  Are you also running an opcode cache?  From there
 you can use data, block, or full page caching.  Finally you can figure
 out if you want to store it in flat files or memory.  I'd start by
 knowing what is actually the slow part using Xdebug and nail a few
 down.

 There is no end all solution.  Some pages really don't have a lot
 going on and are hardly updated so full page is fine.  Others might
 have something that is hard to generate on a sidebar, so block caching
 would be more suitable for that.  As previously mentioned, Zend_Cache
 is up to the task.  There is also a PEAR package called Cache_Lite
 which would work to if you're interested in file based caching.

 
 So dreams do come true...
 
 Thank you for the wonderful insight.  I've been reading about the
 memcached and Xdebug and Zend_Cache.  I've got lots to learn, but it is
 exactly the type of material i was trying to find.
 
 I am not currently running an opcode cache.  I may be doing premature
 optimization, but i want to design the entire system intelligently from
 the get go rather than having to rebuild later.  you know 'work smarter
 not harder'
 
 Is it possible to run xdebug on a virtual host server on which i do not
 have shell access?  I can modify php.ini via cgi, but I don't know if
 i'd be able to view the results of xdebug on the machine.  Your opinion
 would be appreciated.
 
 Thanks so much, i feel like i've just been shown a whole new world.
 dK
 `

I still have to (fully) rtfm.  But i was wondering if the following
scenario(s) is(are) possible.

-Does memcached store the same data under different keys in the same spot?

From my reading so far, i do not think so.
My understanding is that currently memcached goes like as follows:
key-key_hash-server-data_value
but this approach could conceivably store the same data_value under
different keys (thus consuming unneeded memory)

What i'd like it to do is the following:
key-key_hash-server-data_hash-server-data_value

That is, each key has the data_hash as its value.  Then one uses this
data_hash as the new key which has the data_value as its value.
This way the only data that is replicated would be the relatively small
data_hash, but the (larger) data itself would not be replicated.

This would allow for the user to use different keys to access the same
data.  This would be needed when seemingly different keys happen to
share the same data, but would be too costly to recognize, predict, and
accommodate such associations

This doubles the number of calls to the server, but could conceivable
save a great deal of memory for more cached objects.  What would be even
slicker is if the programmer could use either approach within the same
script.  For example, if the programmer new for (almost) certain that a
certain key would never have the same data signature as any other key,
she could then use the original method and save on the overhead of
storing key_hash to data_hashes pairs.

Also, I really like the idea behind zend_cache that I can use memcache/d
as the backend.  That's pretty modular!

I have three direct questions:
1) Is the above approach wise or have i violated some basic caching
principle?

2) Is the php memcache/memcached class extendable (so that I can
implement 1 above)?

3) If 2) is yes, can I use this extendable class as the backend for
zend_cache?

Thanks,
dK
`


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



Re: [PHP] Internal PHP caching methodology

2009-07-17 Thread Daniel Kolbo
Eric Butera wrote:
 On Thu, Jul 16, 2009 at 5:50 PM, Daniel Kolbokolb0...@umn.edu wrote:
 Hello,

 Call me a dreamer...but I got to ask.

 Is there any software for helping speed up PHP by utilizing internal PHP
 caching?

 I am not talking about the external php cache/header control.  Smarty
 caching doesn't give me the control I need either.

 I would like to cache to a finer level than page by page, but rather on
 a module by module basis.  Each of my pages contains a subset of
 modules.  The content of these modules changes based upon certain
 criteria (link, time, session data, but is sometimes static across the
 site).  I would like to be able to cache individual modules
 (preferably based upon frequency and time to generate).

 I am trying to develop a way to do this, but I have to think a brighter
 mind has come before me and hopefully arrived at a solution.

 As always any help/thoughts are much appreciated, except for that one
 guy's comments (you all know who I am talking) ~ jk ;)

 Thanks,
 `

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


 
 Have you actually profiled your code to see where the pain points are
 vs saying 'module?'  Are you also running an opcode cache?  From there
 you can use data, block, or full page caching.  Finally you can figure
 out if you want to store it in flat files or memory.  I'd start by
 knowing what is actually the slow part using Xdebug and nail a few
 down.
 
 There is no end all solution.  Some pages really don't have a lot
 going on and are hardly updated so full page is fine.  Others might
 have something that is hard to generate on a sidebar, so block caching
 would be more suitable for that.  As previously mentioned, Zend_Cache
 is up to the task.  There is also a PEAR package called Cache_Lite
 which would work to if you're interested in file based caching.
 

So dreams do come true...

Thank you for the wonderful insight.  I've been reading about the
memcached and Xdebug and Zend_Cache.  I've got lots to learn, but it is
exactly the type of material i was trying to find.

I am not currently running an opcode cache.  I may be doing premature
optimization, but i want to design the entire system intelligently from
the get go rather than having to rebuild later.  you know 'work smarter
not harder'

Is it possible to run xdebug on a virtual host server on which i do not
have shell access?  I can modify php.ini via cgi, but I don't know if
i'd be able to view the results of xdebug on the machine.  Your opinion
would be appreciated.

Thanks so much, i feel like i've just been shown a whole new world.
dK
`


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



[PHP] Internal PHP caching methodology

2009-07-16 Thread Daniel Kolbo
Hello,

Call me a dreamer...but I got to ask.

Is there any software for helping speed up PHP by utilizing internal PHP
caching?

I am not talking about the external php cache/header control.  Smarty
caching doesn't give me the control I need either.

I would like to cache to a finer level than page by page, but rather on
a module by module basis.  Each of my pages contains a subset of
modules.  The content of these modules changes based upon certain
criteria (link, time, session data, but is sometimes static across the
site).  I would like to be able to cache individual modules
(preferably based upon frequency and time to generate).

I am trying to develop a way to do this, but I have to think a brighter
mind has come before me and hopefully arrived at a solution.

As always any help/thoughts are much appreciated, except for that one
guy's comments (you all know who I am talking) ~ jk ;)

Thanks,
`

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



Re: [PHP] Internal PHP caching methodology

2009-07-16 Thread Phpster





On Jul 16, 2009, at 5:50 PM, Daniel Kolbo kolb0...@umn.edu wrote:


Hello,

Call me a dreamer...but I got to ask.

Is there any software for helping speed up PHP by utilizing internal  
PHP

caching?

I am not talking about the external php cache/header control.  Smarty
caching doesn't give me the control I need either.

I would like to cache to a finer level than page by page, but rather  
on

a module by module basis.  Each of my pages contains a subset of
modules.  The content of these modules changes based upon certain
criteria (link, time, session data, but is sometimes static across the
site).  I would like to be able to cache individual modules
(preferably based upon frequency and time to generate).

I am trying to develop a way to do this, but I have to think a  
brighter

mind has come before me and hopefully arrived at a solution.

As always any help/thoughts are much appreciated, except for that one
guy's comments (you all know who I am talking) ~ jk ;)

Thanks,
`

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



Memcache
Apc
Zend_cache

Google php caching

Bastien

Sent from my iPod

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



Re: [PHP] Internal PHP caching methodology

2009-07-16 Thread Eric Butera
On Thu, Jul 16, 2009 at 5:50 PM, Daniel Kolbokolb0...@umn.edu wrote:
 Hello,

 Call me a dreamer...but I got to ask.

 Is there any software for helping speed up PHP by utilizing internal PHP
 caching?

 I am not talking about the external php cache/header control.  Smarty
 caching doesn't give me the control I need either.

 I would like to cache to a finer level than page by page, but rather on
 a module by module basis.  Each of my pages contains a subset of
 modules.  The content of these modules changes based upon certain
 criteria (link, time, session data, but is sometimes static across the
 site).  I would like to be able to cache individual modules
 (preferably based upon frequency and time to generate).

 I am trying to develop a way to do this, but I have to think a brighter
 mind has come before me and hopefully arrived at a solution.

 As always any help/thoughts are much appreciated, except for that one
 guy's comments (you all know who I am talking) ~ jk ;)

 Thanks,
 `

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



Have you actually profiled your code to see where the pain points are
vs saying 'module?'  Are you also running an opcode cache?  From there
you can use data, block, or full page caching.  Finally you can figure
out if you want to store it in flat files or memory.  I'd start by
knowing what is actually the slow part using Xdebug and nail a few
down.

There is no end all solution.  Some pages really don't have a lot
going on and are hardly updated so full page is fine.  Others might
have something that is hard to generate on a sidebar, so block caching
would be more suitable for that.  As previously mentioned, Zend_Cache
is up to the task.  There is also a PEAR package called Cache_Lite
which would work to if you're interested in file based caching.

-- 
http://www.ericbutera.us/

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



Re: [PHP] Caching

2009-04-11 Thread Richard Heyes
 Hey! About   Header set Expires Thu, 15 Apr 2010 20:00:00 GMT 
 The problem is the files might change, lets say - every week. How can I use
  Header set Expires Thu, 15 Apr 2010 20:00:00 GMT to something like

 Header set Expires today plus week

 (or X seconds / y minutes / etc...)

In that case you will want to use Cache-Control instead:

Header set Cache-Control private,public,max-age=604800

The max-age is the number of seconds (1 week in this case) that the
page is cached for. The private and public determine which kinds of
cache should cache it. IIRC (which isn't likely).

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.net (Updated April 11th)

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



Re: [PHP] Caching

2009-04-10 Thread Richard Heyes
Hi,

 I started caching some of the static files on my application,
 I was wondering - Lets say I have an article on my website and I *want* to
 cache it. How will I cache it AND will be able to make my visitors
 re-cache it if it has been changed?

Work from the last modified date/time on the file. When you update the
file it will change. Though if your files really are static, then
there's little point - the OS will do a far better job of caching them
than you will.

Also, you may also want to have a goosey at the Cache-Control: HTTP
header over Expires:. It can give you more control.

 How do I use *Header set Expires* (on htaccess) and specifying in a week?

A quick Google found this:

Header set Expires Thu, 15 Apr 2010 20:00:00 GMT

-- 
Richard Heyes

HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
http://www.rgraph.net (Updated March 28th)

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



Re: [PHP] Caching

2009-04-10 Thread דניאל דנון
Hey! About   Header set Expires Thu, 15 Apr 2010 20:00:00 GMT 
The problem is the files might change, lets say - every week. How can I use
 Header set Expires Thu, 15 Apr 2010 20:00:00 GMT to something like

Header set Expires today plus week

(or X seconds / y minutes / etc...)

On Fri, Apr 10, 2009 at 12:15 PM, Richard Heyes rich...@php.net wrote:

 Hi,

  I started caching some of the static files on my application,
  I was wondering - Lets say I have an article on my website and I *want*
 to
  cache it. How will I cache it AND will be able to make my visitors
  re-cache it if it has been changed?

 Work from the last modified date/time on the file. When you update the
 file it will change. Though if your files really are static, then
 there's little point - the OS will do a far better job of caching them
 than you will.

 Also, you may also want to have a goosey at the Cache-Control: HTTP
 header over Expires:. It can give you more control.

  How do I use *Header set Expires* (on htaccess) and specifying in a
 week?

 A quick Google found this:

 Header set Expires Thu, 15 Apr 2010 20:00:00 GMT

 --
 Richard Heyes

 HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
 http://www.rgraph.net (Updated March 28th)



[PHP] Caching

2009-04-09 Thread דניאל דנון
I started caching some of the static files on my application,
I was wondering - Lets say I have an article on my website and I *want* to
cache it. How will I cache it AND will be able to make my visitors
re-cache it if it has been changed?

I read how to do that on static pages, but couldn't find any reference that
does not use mod_expires (since I don't have it)...


And, if I am already sending a message,

How do I use *Header set Expires* (on htaccess) and specifying in a week?
Couldn't find any answer to this question as well..


[PHP] Caching and Optimization

2008-06-05 Thread VamVan
Hello All,

Today my question is about the all important topic Web Optimization

What kind of caching mechanisms can I use for Mysql Queries? I was wondering
if you have some methods would you share some code?

What kind of caching and optimization mechanisms can I use for frequent Web
Service calls?

Any kind of code explaining the process would be highly appreciated...

Thanks


Re: [PHP] Caching and Optimization

2008-06-05 Thread Nathan Nobbe
On Thu, Jun 5, 2008 at 10:16 AM, VamVan [EMAIL PROTECTED] wrote:

 Hello All,

 Today my question is about the all important topic Web Optimization

 What kind of caching mechanisms can I use for Mysql Queries?


mysql has its own caching support, worth looking into.  you can also cache
query results on the webserver.  there you have a variety of mediums to save
the queries in, files (session perhaps), apc, memcache, etc..


 What kind of caching and optimization mechanisms can I use for frequent Web
 Service calls?


typically, reverse proxies are used for this purpose.  squid is very
popular, also, in apache 2.2 mod_proxy + mod_cache is looking pretty sweet
;)

Any kind of code explaining the process would be highly appreciated...


the only place in here you would need any php code would be caching sql
queries on the webserver.  its not too difficult really (but there is a
large gradient of complexity), here is a super trivial example,

$query = 'some sql';
if(in_cache($query))
  return fetch_from_cache($query);
else {
  $resultSet = mysql_query($query);
  store_in_cache($query, $resultSet);
  return $resultSet;
}

-nathan


[PHP] Caching options - trunkcache?

2007-03-12 Thread Merlin

Hi there,

I am looking for a replacement of php trunkcache. As far as I can see, 
there is no further development and I had to take it offline due a 
system update and compatibility issues.


What would you guys recommend for a free caching system on a LAMP 
environment running php 4.x apache 1.x and mysql 3.x


Thank you for any advice.

Merlin

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



Re: [PHP] Caching options - trunkcache?

2007-03-12 Thread Jochem Maas
Merlin wrote:
 Hi there,
 
 I am looking for a replacement of php trunkcache. As far as I can see,
 there is no further development and I had to take it offline due a
 system update and compatibility issues.
 
 What would you guys recommend for a free caching system on a LAMP
 environment running php 4.x apache 1.x and mysql 3.x

caching what exactly? opcodes? query results? abitrary data structures?
'pre-compiled' templates? html output? elephants?

try here: http://php.net/apc
or here?: http://www.google.nl/search?q=php4+caching

ps - there are currently no projects that support elephant caching, I'm fairly 
sure.

 
 Thank you for any advice.
 
 Merlin
 

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



Re: [PHP] Caching options - trunkcache?

2007-03-12 Thread clive

Merlin wrote:

I am looking for a replacement of php trunkcache. 

I think you meant turck mmcache?

have a look at these:

http://eaccelerator.net (derivative of mmcache last release: 2006/02/15)
http://www.php-accelerator.co.uk/


--
Regards,

Clive.

Real Time Travel Connections


{No electrons were harmed in the creation, transmission or reading of 
this email. However, many were excited and some may well have enjoyed 
the experience.}


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



Re: [PHP] Caching options - trunkcache?

2007-03-12 Thread Merlin

clive schrieb:

Merlin wrote:

I am looking for a replacement of php trunkcache. 

I think you meant turck mmcache?

have a look at these:

http://eaccelerator.net (derivative of mmcache last release: 2006/02/15)
http://www.php-accelerator.co.uk/




thanx I tried php-accelerator. Lets see if this will bring some extra 
performance.


Merlin

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



Re: [PHP] Caching options - trunkcache?

2007-03-12 Thread Richard Lynch
APC is getting rolled into PHP 6, allegedly.

So that's kind of a no-brainer to choose, imho, as then you can be
forwards-compatible with something that turns into the PHP Dev Teams'
maintenance work instead of your own.

Zend Cache may still be faster, as they got the jump on the PHP code
caching game.  So if you've got the $$$, benchmark both and see which
helps you more.

YMMV
NAIAA
IANAL

On Mon, March 12, 2007 7:18 am, Merlin wrote:
 Hi there,

 I am looking for a replacement of php trunkcache. As far as I can see,
 there is no further development and I had to take it offline due a
 system update and compatibility issues.

 What would you guys recommend for a free caching system on a LAMP
 environment running php 4.x apache 1.x and mysql 3.x

 Thank you for any advice.

 Merlin

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




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] Caching problems .. I think

2005-10-16 Thread Søren Schimkat

Hi guys

I have a rather simple setup:

A few forms chained after each other (the first leds to the second which 
leeds to the third and so on)

I´m using sessions - and starting each page like this:

header('Expires: ' . gmdate('D, d M Y H:i:s', (time() + (60 * 10))) . ' 
GMT');

session_cache_limiter('private_no_expire');
session_start();

... which I believe gives each page (and form result) a caching time of 
10 minutes. The problem is that when using the back button in IE - IE 
complains about the page and tells med that this page is the result of a 
form and that the content has been blocked.


Can anyone tell me how to awoid this problem, so the backbutton can be 
used, and stil give each page a caching time of 10 minutes?


--
Regards Søren Schimkat

www.schimkat.dk

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



Re: [PHP] caching parsed XML files as DOM objects in memory

2005-10-10 Thread Petr Smith

I'm writing template
library based on XML. But it's not very efficient to create new
DomDocument, load XML template, process it and show on every page hit.
XML parsing is not very fast, and because I'm parsing XHTML with
entities, all DTD's are parsed too. I thought about something similar
to
java - there I can have servlet which lives all the time the server
lives. It can load XML and parse it only for the first time and send
DOM
objects to another servlets.
I need something similar with PHP, can it be done?



I think you might want to avoid trying to do it the Java way in PHP.

PHP is share-none by architectural design, not accident, so that you
can scale up by throwing as much cheap/stock hardware at it as you can
afford instead of being forced to buy a single bigger hardware box in
the center for the shared data.

It would probably make a lot more sense to store whatever you use to
uniquely identify your XML source and the results in a database or
filesystem, and then compare time-stamps in some simple business logic
to decide to re-parse or serve from cache.

Yes, that does just foist off the shared-data to the database, or
file-system -- but those systems are specifically designed to handle
this task for a long time now with a lot of heavily tested and
optimized code.  PHP and even Java can't really match that level of
testing/optimization yet simply due to relative ages.

If db and filesystem are too slow or you already have too many
machines running this code-base, you could write your own PHP XML
cache server that takes an XML id and either gets it from the db/file
cache, or parses the true original, and set up your own server for
this express purpose and really make it scream on speed...  That's
quite a bit of work, though, and for the simplicity of the code
involved, you may be better off writing it as a C application... Or
out-sourcing that bit of code to be written with specific timing
targets for the employee to meet/beat to get their just due $$$.



Thanks for lot of ideas, you are probably right I'm trying to think it 
the java way.
But my main bottleneck is the XML parsing part, so I was trying to avoid 
it somehow. It is also more slower because my XML is not normal XML, 
but XHTML file so I need to have resolveExternals=true to parse files 
with XHTML entities (nbsp; lt; etc.)
So I cannot cache my final objects to files or database, because it 
involves some sort of serialization and later (when accessing the cache) 
some unserialization (the slow parse part).

That was the reason I thought about caching in memory.
I'm sure I can setup some XML cache server but again, how will I 
exchange data with it? I cannot move all object trees between servers 
(XML files couldn't be serialized).
There is last chance to write some C extension, but why use PHP then? I 
can write it all in C, also with my own HTTP server :)
I think there should be some way to have all objects (including PHP 
internal) stored somewhere in memory and living all the time the web 
server lives. It solves many types of problems.


Petr

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



Re: [PHP] caching parsed XML files as DOM objects in memory

2005-10-07 Thread Richard Lynch
On Wed, October 5, 2005 8:11 am, Petr Smith wrote:
 is it possible to cache parsed XML files somehow?

I think this is the wrong question...

I mean, OF COURSE, it's possible to cache them SOMEHOW.

You could toss them in your file system, or a database, insert a
machine with squid on it into the chain, or train an army of squirrels
to memorize the XML.

That last one might be impractical, as you'd need to breed super-smart
squirrels first :-)

 I'm writing template
 library based on XML. But it's not very efficient to create new
 DomDocument, load XML template, process it and show on every page hit.
 XML parsing is not very fast, and because I'm parsing XHTML with
 entities, all DTD's are parsed too. I thought about something similar
 to
 java - there I can have servlet which lives all the time the server
 lives. It can load XML and parse it only for the first time and send
 DOM
 objects to another servlets.
 I need something similar with PHP, can it be done?

I think you might want to avoid trying to do it the Java way in PHP.

PHP is share-none by architectural design, not accident, so that you
can scale up by throwing as much cheap/stock hardware at it as you can
afford instead of being forced to buy a single bigger hardware box in
the center for the shared data.

It would probably make a lot more sense to store whatever you use to
uniquely identify your XML source and the results in a database or
filesystem, and then compare time-stamps in some simple business logic
to decide to re-parse or serve from cache.

Yes, that does just foist off the shared-data to the database, or
file-system -- but those systems are specifically designed to handle
this task for a long time now with a lot of heavily tested and
optimized code.  PHP and even Java can't really match that level of
testing/optimization yet simply due to relative ages.

If db and filesystem are too slow or you already have too many
machines running this code-base, you could write your own PHP XML
cache server that takes an XML id and either gets it from the db/file
cache, or parses the true original, and set up your own server for
this express purpose and really make it scream on speed...  That's
quite a bit of work, though, and for the simplicity of the code
involved, you may be better off writing it as a C application... Or
out-sourcing that bit of code to be written with specific timing
targets for the employee to meet/beat to get their just due $$$.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] caching parsed XML files... FALSE advice, still not working

2005-10-06 Thread Petr Smith

Petr Smith wrote:

Jasper Bryant-Greene wrote:


Petr Smith wrote:

is it possible to cache parsed XML files somehow? I'm writing 
template library based on XML. But it's not very efficient to create 
new DomDocument, load XML template, process it and show on every page 
hit. XML parsing is not very fast, and because I'm parsing XHTML with 
entities, all DTD's are parsed too. I thought about something similar 
to java - there I can have servlet which lives all the time the 
server lives. It can load XML and parse it only for the first time 
and send DOM objects to another servlets.

I need something similar with PHP, can it be done?




This question seems to come up every other week on this list. Have a 
look at APC[1]; you can cache objects with its apc_store() and 
apc_fetch() functions.


[1] http://php.net/apc



Thanks, looks usable.. I hope it can synchronize successfully between 
different calls on heave load. I'll try it, I don't know why I missed it 
when browsing documentation.


Petr


Hi,

it's not working at all. And it could never work. I don't think it's 
funny to write false advices to people every other week.
I've installed APC cache, tried to save XML. It was not working. 
apc_fetch returned NULL every time.


$dom = apc_fetch(dom);
if ($dom === false) {
$dom = new DomDocument();
$dom-load(browsers.html);   
$store = apc_store(dom, $dom);
echo store finished: $store;
}
echo $dom-saveXML();

When I looked into documentation for APC - there is this sentence: And 
apc_store() currently doesn't work at all for (internal) classes in PHP5 
right now.. And all the XML stuff is what? Internal PHP5 classes!


Please don't confuse people with false edvices next time. Better to say 
nothing then solutions that are not working. I lost lot of time and got 
only ton of disapointment.


And still no solution to my problem :(.

Petr

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



Re: [PHP] caching parsed XML files... FALSE advice, still not working

2005-10-06 Thread Jasper Bryant-Greene

Petr Smith wrote:


it's not working at all. And it could never work. I don't think it's 
funny to write false advices to people every other week.
I've installed APC cache, tried to save XML. It was not working. 
apc_fetch returned NULL every time.

[snip]

When I looked into documentation for APC - there is this sentence: And 
apc_store() currently doesn't work at all for (internal) classes in PHP5 
right now.. And all the XML stuff is what? Internal PHP5 classes!


I can only apologise for your wasted time -- I seem to remember it 
working but may have been caching a different class; it was a while ago.


Perhaps Rasmus or someone with more knowledge of APC internals could 
comment? I find APC very useful but it would be extremely useful to be 
able to cache the DOMDocument class.


Could you please post the link to the docs from which you got that 
quote? I cannot find any words to that effect on either the php.net or 
pecl.php.net websites, but maybe I'm not looking hard enough...


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



Re: [PHP] caching parsed XML files as DOM objects in memory

2005-10-06 Thread Petr Smith
it's not working at all. And it could never work. I don't think it's 
funny to write false advices to people every other week.
I've installed APC cache, tried to save XML. It was not working. 
apc_fetch returned NULL every time.

[snip]

When I looked into documentation for APC - there is this sentence: 
And apc_store() currently doesn't work at all for (internal) classes 
in PHP5 right now.. And all the XML stuff is what? Internal PHP5 
classes!


I can only apologise for your wasted time -- I seem to remember it 
working but may have been caching a different class; it was a while ago.


Perhaps Rasmus or someone with more knowledge of APC internals could 
comment? I find APC very useful but it would be extremely useful to be 
able to cache the DOMDocument class.


Could you please post the link to the docs from which you got that 
quote? I cannot find any words to that effect on either the php.net or 
pecl.php.net websites, but maybe I'm not looking hard enough...




Apology accepted. Sorry for my (maybe) too offensive language, I was 
disappointed it's not working.


This quote is from TODO Known Bugs file inside apc distribution 
archive (v3.0.8).


Petr

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



[PHP] caching parsed XML files as DOM objects in memory

2005-10-05 Thread Petr Smith

Hi,

is it possible to cache parsed XML files somehow? I'm writing template 
library based on XML. But it's not very efficient to create new 
DomDocument, load XML template, process it and show on every page hit. 
XML parsing is not very fast, and because I'm parsing XHTML with 
entities, all DTD's are parsed too. I thought about something similar to 
java - there I can have servlet which lives all the time the server 
lives. It can load XML and parse it only for the first time and send DOM 
objects to another servlets.

I need something similar with PHP, can it be done?

Thanks for any ideas,

Petr

ps. I found this project http://www.vl-srm.net/ which maybe can do 
something I need, but it looks dead.


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



RE: [PHP] caching parsed XML files as DOM objects in memory

2005-10-05 Thread Daevid Vincent
Sadly I thought of doing the same thing only to have my face crapped on by
this extreme lameness:

http://www.php.net/manual/en/ref.session.php

Some types of data can not be serialized thus stored in sessions. It
includes resource variables or objects with circular references (i.e.
objects which passes a reference to itself to another object). 

If you figure out a way, please let me/us know... *sigh*

 -Original Message-
 From: Petr Smith [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 05, 2005 6:11 AM
 To: php-general@lists.php.net
 Subject: [PHP] caching parsed XML files as DOM objects in memory
 
 Hi,
 
 is it possible to cache parsed XML files somehow? I'm writing 
 template 
 library based on XML. But it's not very efficient to create new 
 DomDocument, load XML template, process it and show on every 
 page hit. 
 XML parsing is not very fast, and because I'm parsing XHTML with 
 entities, all DTD's are parsed too. I thought about something 
 similar to 
 java - there I can have servlet which lives all the time the server 
 lives. It can load XML and parse it only for the first time 
 and send DOM 
 objects to another servlets.
 I need something similar with PHP, can it be done?
 
 Thanks for any ideas,
 
 Petr
 
 ps. I found this project http://www.vl-srm.net/ which maybe can do 
 something I need, but it looks dead.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP] caching parsed XML files as DOM objects in memory

2005-10-05 Thread Jasper Bryant-Greene

Petr Smith wrote:
is it possible to cache parsed XML files somehow? I'm writing template 
library based on XML. But it's not very efficient to create new 
DomDocument, load XML template, process it and show on every page hit. 
XML parsing is not very fast, and because I'm parsing XHTML with 
entities, all DTD's are parsed too. I thought about something similar to 
java - there I can have servlet which lives all the time the server 
lives. It can load XML and parse it only for the first time and send DOM 
objects to another servlets.

I need something similar with PHP, can it be done?


This question seems to come up every other week on this list. Have a 
look at APC[1]; you can cache objects with its apc_store() and 
apc_fetch() functions.


[1] http://php.net/apc
--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

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



Re: [PHP] caching parsed XML files as DOM objects in memory

2005-10-05 Thread Petr Smith

Jasper Bryant-Greene wrote:

Petr Smith wrote:

is it possible to cache parsed XML files somehow? I'm writing template 
library based on XML. But it's not very efficient to create new 
DomDocument, load XML template, process it and show on every page hit. 
XML parsing is not very fast, and because I'm parsing XHTML with 
entities, all DTD's are parsed too. I thought about something similar 
to java - there I can have servlet which lives all the time the server 
lives. It can load XML and parse it only for the first time and send 
DOM objects to another servlets.

I need something similar with PHP, can it be done?



This question seems to come up every other week on this list. Have a 
look at APC[1]; you can cache objects with its apc_store() and 
apc_fetch() functions.


[1] http://php.net/apc


Thanks, looks usable.. I hope it can synchronize successfully between 
different calls on heave load. I'll try it, I don't know why I missed it 
when browsing documentation.


Petr

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



[PHP] Caching Database Information

2004-08-25 Thread Paul Higgins
Hello all,
I have some questions regarding caching information with PHP.  I was 
thinking that I might cache all information that won't be changing for long 
periods of time...possibly only once a day or so, instead of querying the 
database for information every time.  My question is:  is there such as 
thing as too much caching?

Can I cache too much and therefore negate the advantages of caching?
Thanks,
Paul
_
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


Re: [PHP] Caching Database Information

2004-08-25 Thread Greg Donald
On Wed, 2004-08-25 at 14:52, Paul Higgins wrote:
 Hello all,
 
 I have some questions regarding caching information with PHP.  I was 
 thinking that I might cache all information that won't be changing for long 
 periods of time...possibly only once a day or so, instead of querying the 
 database for information every time.  My question is:  is there such as 
 thing as too much caching?
 
 Can I cache too much and therefore negate the advantages of caching?

As long as the overhead in caching remains less than the overhead in not
caching, I would say maybe.  :)

A single database query returns an array.  You use the array to build a
page.  You cache the page.  The cached version of the page gets hit 100
times.  Is the overhead in pulling the file from your cache 100 times
less than re-doing the query 100 times?  That depends.  Some databases
have query caching, and so do most file systems.  There are also PHP
caching tools like TurkeMM Cache and Zend that cache byte code only.

I'd bench it both ways and then decide based on the queries, the
development environment, and the cache timeout limitations/requirements.


-- 
Greg Donald

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



RE: [PHP] Caching Database Information

2004-08-25 Thread Greg Donald
On Wed, 2004-08-25 at 16:32, Scott Hyndman wrote:
 I've found that caching LARGE datasets can be really useful. Filesystem
 access is blazing fast, and at least in my case, I've found it to be
 significantly faster than the time it takes to process a query and
 return the dataset.
 
 Too much caching? I don't think so. Just use it in the right places. You
 don't want to be caching something that needs to show change from second
 to second.

Just a hint.. You might try your Reply to all option next time. 
Especially since it's a list serve, and especially since I'm not the
poster of the original question.


-- 
Greg Donald

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



Re: [PHP] Caching Database Information

2004-08-25 Thread raditha dissanayake
Paul Higgins wrote:
Hello all,
I have some questions regarding caching information with PHP.  I was 
thinking that I might cache all information that won't be changing for 
long periods of time...possibly only once a day or so, instead of 
querying the database for information every time.  My question is:  is 
there such as thing as too much caching?

Take a look at running Squid in httpd accelarator mode as well. Other 
options to look at include installing turck (this only caches the 
compiled version of the script - not the scripts output). also i believe 
there is an extension named memcached or something similar which may be 
what you want.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] innodb + php caching issues

2003-09-14 Thread esctoday.com | Wouter van Vliet
Might want to try to send aa 'commit' command to the database. Just the
first thing that enters my mind

 - -Original Message-
 - From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 - Sent: zondag 14 september 2003 7:55
 - To: [EMAIL PROTECTED]
 - Subject: [PHP] innodb + php caching issues
 - 
 - Hi there i have experienced a wierd bug , where after i 
 - commit a query in innodb that change wont be viewable until 
 - i refresh the page , this doesnt happen in a similar system 
 - framwork using myisam tables the change is viewable, what 
 - could be the problem ? should i just give nocache headers 
 - for a quick fix?
 - 
 - --
 - PHP General Mailing List (http://www.php.net/) To 
 - unsubscribe, visit: http://www.php.net/unsub.php
 - 

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



Re: [PHP] caching program

2003-09-14 Thread Curt Zirzow
* Thus wrote Andrea Tricco ([EMAIL PROTECTED]):
 For the images that don't contain http://; my program is already able to
 get them from the web server.
 In other cases, I have to determine the name of the directory where the html
 page is located.
 Thus, the equivocal paths are the problem, for example:
 
 www.php.net/manual/it/index.php
 
 www.php.net/manual/it/
 
 www.php.net/manual/it
 
 The reply of the server web is the same in the three cases.

Not true, Like I had posted ealier the last url apache will
redirect the person requesting the file to:

www.php.net/manual/it/

php does this transparently with the current method you are using
to obtain the files.


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] caching program...

2003-09-13 Thread Curt Zirzow
* Thus wrote Andrea Tricco ([EMAIL PROTECTED]):
 Hi,

Hello

 
 I'm using the function file_get_contents() to replicate the content of a
 remote html page on my server.
 
 But, the function file_get_contents() works even when the name of the file
 is not specified. For example:
 
 http://www.php.net; rather that http://php.net/index.php;

http://php.net/   - apache serves index.php
http://php.net- apache redirects to http://php.net/
http://php.net/index.php  - servers index.php

All three of these will show the same content.

 
 Does a method exist to know the name of the file received form web server?

Nope

 
 I would like to write a program that automatically downloads the images
 inserted into a html page.

The odds are if you right one, it wont be 100% compatible with all
sites.  What in essance you are doing is writing a web browser, and
there are a lot of things that need to be taken care of to handle
special cases.


 
 For this reason, I need to determine the paths of the images in order to get
 them from the web server.

For starters probably reading up on HTML and HTTP specifications
might be a good place to start. ( http://w3c.org )

 
 In other words, my program should work as the Save as function (File menu)
 of any Web browser.

There are alternative choices, there are programs out there like
webget and wget that will automatically do what you want to do. You
could use those programs with a system call. 

 
 
 
 Can anybody help me?

I hope I did already :)


Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



[PHP] innodb + php caching issues

2003-09-13 Thread daniel
Hi there i have experienced a wierd bug , where after i commit a query in
innodb that change wont be viewable until i refresh the page , this doesnt
happen in a similar system framwork using myisam tables the change is
viewable, what could be the problem ? should i just give nocache headers
for a quick fix?

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



[PHP] caching program...

2003-09-12 Thread Andrea Tricco
Hi,



I'm using the function file_get_contents() to replicate the content of a
remote html page on my server.

But, the function file_get_contents() works even when the name of the file
is not specified. For example:

http://www.php.net; rather that http://php.net/index.php;



Does a method exist to know the name of the file received form web server?



I would like to write a program that automatically downloads the images
inserted into a html page.

For this reason, I need to determine the paths of the images in order to get
them from the web server.



In other words, my program should work as the Save as function (File menu)
of any Web browser.



Can anybody help me?



Best regards.



Andrea

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



Re: [PHP] caching program...

2003-09-12 Thread Marek Kilimajer
No way, it might be anything from apache's DirectoryIndex directive. 
Browsers don't know that either.

Andrea Tricco wrote:

Hi,



I'm using the function file_get_contents() to replicate the content of a
remote html page on my server.
But, the function file_get_contents() works even when the name of the file
is not specified. For example:
http://www.php.net; rather that http://php.net/index.php;



Does a method exist to know the name of the file received form web server?



I would like to write a program that automatically downloads the images
inserted into a html page.
For this reason, I need to determine the paths of the images in order to get
them from the web server.


In other words, my program should work as the Save as function (File menu)
of any Web browser.


Can anybody help me?



Best regards.



Andrea

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


[PHP] caching program

2003-09-12 Thread Andrea Tricco
Hi,
I'm using the function file_get_contents() to replicate the content of a
remote html page on my server.
But, the function file_get_contents() works even when the name of the file
is not specified. For example:

http://www.php.net; rather that http://php.net/index.php;

Does a method exist to know the name of the file received form web server?

I would like to write a program that automatically downloads the images
inserted into a html page.
For this reason, I need to determine the paths of the images in order to get
them from the web server.
In other words, my program should work as the Save as function (File menu)
of any Web browser.

Can anybody help me?

Best regards.
Andrea

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



Re: [PHP] caching program

2003-09-12 Thread Ryan Gibson
You could pull out all the img src attributes and if they don't contain
http://; then prepeand the address of te page then download otherwise just
downlocad the url, but to get the page to work in the new location you may
have to replace the img src attributes

Ryan Gibson
---
[EMAIL PROTECTED]

On 17/9/03 11:16 am, Andrea Tricco [EMAIL PROTECTED] wrote:

 Hi,
 I'm using the function file_get_contents() to replicate the content of a
 remote html page on my server.
 But, the function file_get_contents() works even when the name of the file
 is not specified. For example:
 
 http://www.php.net; rather that http://php.net/index.php;
 
 Does a method exist to know the name of the file received form web server?
 
 I would like to write a program that automatically downloads the images
 inserted into a html page.
 For this reason, I need to determine the paths of the images in order to get
 them from the web server.
 In other words, my program should work as the Save as function (File menu)
 of any Web browser.
 
 Can anybody help me?
 
 Best regards.
 Andrea

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



Re: [PHP] caching program

2003-09-12 Thread Andrea Tricco
For the images that don't contain http://; my program is already able to
get them from the web server.
In other cases, I have to determine the name of the directory where the html
page is located.
Thus, the equivocal paths are the problem, for example:

www.php.net/manual/it/index.php

www.php.net/manual/it/

www.php.net/manual/it

The reply of the server web is the same in the three cases.
The input of the my program could be any paths between the mentioned ones. I
need to poll out the path www.php.net/manual/it/

Best regards.
Andrea


- Original Message - 
From: Ryan Gibson [EMAIL PROTECTED]
To: Andrea Tricco [EMAIL PROTECTED]; php-general
[EMAIL PROTECTED]
Sent: Friday, September 12, 2003 12:26 PM
Subject: Re: [PHP] caching program


 You could pull out all the img src attributes and if they don't contain
 http://; then prepeand the address of te page then download otherwise
just
 downlocad the url, but to get the page to work in the new location you may
 have to replace the img src attributes

 Ryan Gibson
 ---
 [EMAIL PROTECTED]

 On 17/9/03 11:16 am, Andrea Tricco [EMAIL PROTECTED] wrote:

  Hi,
  I'm using the function file_get_contents() to replicate the content of
a
  remote html page on my server.
  But, the function file_get_contents() works even when the name of the
file
  is not specified. For example:
 
  http://www.php.net; rather that http://php.net/index.php;
 
  Does a method exist to know the name of the file received form web
server?
 
  I would like to write a program that automatically downloads the images
  inserted into a html page.
  For this reason, I need to determine the paths of the images in order to
get
  them from the web server.
  In other words, my program should work as the Save as function (File
menu)
  of any Web browser.
 
  Can anybody help me?
 
  Best regards.
  Andrea





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



Re: [PHP] caching program

2003-09-12 Thread Andrea Tricco
I'm sorry, but in the previuos email there has been an error.
I'm sending correct one.
-
For the images that contain http://; my program is already able to
get them from the web server.
In other cases, I have to determine the name of the directory where the html
page is located.
Thus, the equivocal paths are the problem, for example:

www.php.net/manual/it/index.php

www.php.net/manual/it/

www.php.net/manual/it

The reply of the server web is the same in the three cases.
The input of the my program could be any paths between the mentioned ones. I
need to poll out the path www.php.net/manual/it/

Best regards.
Andrea

- Original Message - 
From: Andrea Tricco [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Wednesday, September 17, 2003 1:11 PM
Subject: Re: [PHP] caching program


 For the images that don't contain http://; my program is already able to
 get them from the web server.
 In other cases, I have to determine the name of the directory where the
html
 page is located.
 Thus, the equivocal paths are the problem, for example:

 www.php.net/manual/it/index.php

 www.php.net/manual/it/

 www.php.net/manual/it

 The reply of the server web is the same in the three cases.
 The input of the my program could be any paths between the mentioned ones.
I
 need to poll out the path www.php.net/manual/it/

 Best regards.
 Andrea


 - Original Message - 
 From: Ryan Gibson [EMAIL PROTECTED]
 To: Andrea Tricco [EMAIL PROTECTED]; php-general
 [EMAIL PROTECTED]
 Sent: Friday, September 12, 2003 12:26 PM
 Subject: Re: [PHP] caching program


  You could pull out all the img src attributes and if they don't contain
  http://; then prepeand the address of te page then download otherwise
 just
  downlocad the url, but to get the page to work in the new location you
may
  have to replace the img src attributes
 
  Ryan Gibson
  ---
  [EMAIL PROTECTED]
 
  On 17/9/03 11:16 am, Andrea Tricco [EMAIL PROTECTED] wrote:
 
   Hi,
   I'm using the function file_get_contents() to replicate the content
of
 a
   remote html page on my server.
   But, the function file_get_contents() works even when the name of the
 file
   is not specified. For example:
  
   http://www.php.net; rather that http://php.net/index.php;
  
   Does a method exist to know the name of the file received form web
 server?
  
   I would like to write a program that automatically downloads the
images
   inserted into a html page.
   For this reason, I need to determine the paths of the images in order
to
 get
   them from the web server.
   In other words, my program should work as the Save as function (File
 menu)
   of any Web browser.
  
   Can anybody help me?
  
   Best regards.
   Andrea
 
 
 
 

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



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



Re: [PHP] caching program

2003-09-12 Thread Raditha Dissanayake
once upon a long ago someone (i belive his name is Hrvoje Niksic) wrote 
a program called wget so that people do not have to do all this :-)

Andrea Tricco wrote:

Hi,
I'm using the function file_get_contents() to replicate the content of a
remote html page on my server.
But, the function file_get_contents() works even when the name of the file
is not specified. For example:
http://www.php.net; rather that http://php.net/index.php;

Does a method exist to know the name of the file received form web server?

I would like to write a program that automatically downloads the images
inserted into a html page.
For this reason, I need to determine the paths of the images in order to get
them from the web server.
In other words, my program should work as the Save as function (File menu)
of any Web browser.
Can anybody help me?

Best regards.
Andrea
 



--
http://www.radinks.com/upload
Drag and Drop File Uploader.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] caching program

2003-09-12 Thread Ryan Gibson
On 17/9/03 12:18 pm, Andrea Tricco [EMAIL PROTECTED] wrote:

 Thus, the equivocal paths are the problem, for example:
 
 www.php.net/manual/it/index.php
 
 www.php.net/manual/it/


For the above examples the url is the string up to the last '/' char (as
long as the string after the '/' char has an extension ie a dot and three or
chars)

 www.php.net/manual/it
 

This is a bit more tricky, you could just grab the url with and without the
'/' char and compare the two strings (messy I know) and probably won't work
every time, but what does!


Ryan Gibson
---
[EMAIL PROTECTED]

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



[PHP] caching question

2003-07-19 Thread Jean-Christian IMbeault
I am using Apache 1.3.27 and PHP 4.3.3.RC1 and someone has told me that 
my web page cannot be cached but I cannot figure out why. My friend 
tells me my pages all keep sending this in their headers:

Cache-Control: post-check=0, must-revalidate, no-store, no-cache, 
pre-check=0

But I can't figure out why the headers are set like this. I am not 
setting any headers so I am wondering if it is a setting in my web 
server, php.ini file or some other php scripts I have running in the 
background.

Also print_r($HTTP_SERVER_VARS) gives one server variable to be:

[HTTP_CACHE_CONTROL] = max-age=0

What does this variable mean and where was it set?

Any and all help appreciated!

Jean-Christian Imbeault

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


Re: [PHP] caching question

2003-07-19 Thread Curt Zirzow
Jean-Christian IMbeault [EMAIL PROTECTED] wrote:
 I am using Apache 1.3.27 and PHP 4.3.3.RC1 and someone has told me that 
 my web page cannot be cached but I cannot figure out why. My friend 
 tells me my pages all keep sending this in their headers:
 
 Cache-Control: post-check=0, must-revalidate, no-store, no-cache, 
 pre-check=0
 
 But I can't figure out why the headers are set like this. I am not 
 setting any headers so I am wondering if it is a setting in my web 
 server, php.ini file or some other php scripts I have running in the 
 background.

In most cases you dont want your php output to get cached, and so php
will do this automaticly.  You can stop that from happening by sending
the same header with public as the paramater:

  Cache-Control: public

You also might want to set a few others:

/* if you are sending a file send the last modified time */
'Last-Modified: ' . gmdate(D, d M Y H:i:s, $unix_ts . ' GMT')

/* for old ie bug and older proxy caches */
'Pragma: no-cache'); 

/* if this applies */
'Expires: '. gmdate(D, d M Y H:i:s, time()-(1200). ' GMT')


Curt.
-- 


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



RE: [PHP] caching variables and preloading functions

2003-06-02 Thread Lance Lovette
If you are not running PHP under a Windows platform and can compile
extensions into PHP the most efficient way to solve problem #2 may be with a
PHP extension I developed. It handles constants and provides a type of
persistent variable too. It has been immensely useful for my projects.

http://pwee.sourceforge.net/

Lance

 -Original Message-
 From: ssamuel [mailto:[EMAIL PROTECTED]
 Sent: Sunday, May 25, 2003 7:05 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] caching variables and preloading functions


 Hi,

 I am looking for a way to do the following with PHP on Apache.

 1) I have a list of functions that I would like loaded into memory when
 the Apache server starts so that other .PHPs can call these functions at
 any time.  Somewhat of a way to expand the API set for PHP.

 i.e., Say I have a file named init.php which has many functions
 defined.  When the Apache server loads, I want this file to be sourced
 so that these functions are visible to all other phps.

 2) I have several variables, that I want to be cached at server init
 time.  These variables are global variables and live until the server is
 restarted and can be accessed by any .phps.

 Are there any ways to do these?

 thanks,
 sunil.


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




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



Re: [PHP] PHP caching ideas?

2002-10-14 Thread Krzysztof Dziekiewicz

 Is the general logic to slice the page into some general pieces. For example
 ones that have always general data and those that change. Then the ones that 
 don't change are streamed to the user using passthrough and the rest of the 
 page is generated dynamically with the newest relevant data.

If a page has parts that change and not you can make frameset. In a frame that
does not change you send caching headers.
Durign generating page you can cache in memory unchangeble parts.


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




Re: [PHP] PHP caching ideas?

2002-10-14 Thread Maxim Maletsky


The most efficient way would be to cache the heaviest parts of the
scripts. Such parts are database connections and its queries, templates
rendering and any other things like XML, large data loops etc..

What I would suggest is to modulate your application logic by sections
of different functionalities. There you can control the things easier.
For instance, while loading an article out of the database that also
includes several other queries, you can check against the most recent
updated field relevant to that row and compare to the current time. If
it changed since last visit load it again and save (by passing to some
caching script of yours) as a cached file. Something like that. I do it
pretty often, especially for dynamic downloads.

Maxim Maletsky


On Sat, 12 Oct 2002 13:33:32 +
Hans Himmel [EMAIL PROTECTED] wrote:

 Hello there,
 
 How do most people here create their caching logic for PHP scripts? The 
 problem is that most PHP scripts have some part of the page that is unique 
 to each request (let it be current time, e-mail list in an e-mail reading 
 application, session IDs on some servers, or whatever).
 
 Is the general logic to slice the page into some general pieces. For example 
 ones that have always general data and those that change. Then the ones that 
 don't change are streamed to the user using passthrough and the rest of the 
 page is generated dynamically with the newest relevant data.
 
 Or are there any other good ideas to solve PHP caching problems?
 
 Thanks,
 Hans
 
 _
 Join the world’s largest e-mail service with MSN Hotmail. 
 http://www.hotmail.com
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins


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




Re: [PHP] PHP caching ideas?

2002-10-14 Thread olinux

Smarty template will allow you to cache certain
pieces.

http://smarty.php.net

olinux


--- Krzysztof Dziekiewicz [EMAIL PROTECTED] wrote:
  Is the general logic to slice the page into some
 general pieces. For example
  ones that have always general data and those that
 change. Then the ones that 
  don't change are streamed to the user using
 passthrough and the rest of the 
  page is generated dynamically with the newest
 relevant data.
 
 If a page has parts that change and not you can make
 frameset. In a frame that
 does not change you send caching headers.
 Durign generating page you can cache in memory
 unchangeble parts.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


__
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos  More
http://faith.yahoo.com

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




Re: [PHP] PHP caching ideas?

2002-10-14 Thread Maxim Maletsky


Though, I would not reccomend it to you as your caching mechanism. Only
for when you are actually using Smarty.. which is still makes no much
sence since Smarty is saving the compiled version of your file.


Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins


On Mon, 14 Oct 2002 08:02:37 -0700 (PDT)
olinux [EMAIL PROTECTED] wrote:

 Smarty template will allow you to cache certain
 pieces.
 
 http://smarty.php.net
 
 olinux
 
 
 --- Krzysztof Dziekiewicz [EMAIL PROTECTED] wrote:
   Is the general logic to slice the page into some
  general pieces. For example
   ones that have always general data and those that
  change. Then the ones that 
   don't change are streamed to the user using
  passthrough and the rest of the 
   page is generated dynamically with the newest
  relevant data.
  
  If a page has parts that change and not you can make
  frameset. In a frame that
  does not change you send caching headers.
  Durign generating page you can cache in memory
  unchangeble parts.
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 __
 Do you Yahoo!?
 Faith Hill - Exclusive Performances, Videos  More
 http://faith.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
Maxim Maletsky
[EMAIL PROTECTED]

www.PHPBeginner.com  // where PHP Begins


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




[PHP] PHP caching ideas?

2002-10-12 Thread Hans Himmel

Hello there,

How do most people here create their caching logic for PHP scripts? The 
problem is that most PHP scripts have some part of the page that is unique 
to each request (let it be current time, e-mail list in an e-mail reading 
application, session IDs on some servers, or whatever).

Is the general logic to slice the page into some general pieces. For example 
ones that have always general data and those that change. Then the ones that 
don't change are streamed to the user using passthrough and the rest of the 
page is generated dynamically with the newest relevant data.

Or are there any other good ideas to solve PHP caching problems?

Thanks,
Hans

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




[PHP] Caching Problem

2002-09-04 Thread Roland Swingler

Hi

I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5)

The page I want to use is a simple file upload page that works by:

?php
if ($HTTP_POST_VARS['submit'] == submit) {
  then upload the file...
}
?
Rest of document.

The form action returns to the same page (to allow you to upload another file).

This works fine, but if you press the refresh btn, the file keeps uploading pictures. 
If you click in the address bar  press return, this does not happen.

I have included the http headers to prevent caching as described in the documentation, 
but this hasn't seemed to work.

Is this a quirk of the browser/os combination or is there something i'm missing.

TIA

Roland


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




Re: [PHP] Caching Problem

2002-09-04 Thread Jed Verity

Hi, Roland,

There might be a better way to do this, but you could try to use the
header() function after your upload takes place to redirect the browser to
the same page, using GET. Something like...

?php
if ($HTTP_POST_VARS['submit'] == submit) {
then upload the file...
header(Location: http://.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].);
}
?

Or something like that. HTH,
Jed

On the threshold of genius, Roland Swingler wrote:

 Hi
 
 I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5)
 
 The page I want to use is a simple file upload page that works by:
 
 ?php
 if ($HTTP_POST_VARS['submit'] == submit) {
 then upload the file...
 }
 ?
 Rest of document.
 
 The form action returns to the same page (to allow you to upload another
 file).
 
 This works fine, but if you press the refresh btn, the file keeps uploading
 pictures. If you click in the address bar  press return, this does not
 happen.
 
 I have included the http headers to prevent caching as described in the
 documentation, but this hasn't seemed to work.
 
 Is this a quirk of the browser/os combination or is there something i'm
 missing.
 
 TIA
 
 Roland
 


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




Re: [PHP] Caching Problem

2002-09-04 Thread Marek Kilimajer

Use header(Location: page.php); to redirect the browser, you should 
allways do it after a post that changes or adds or deletes some data on 
the server.

Roland Swingler wrote:

Hi

I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5)

The page I want to use is a simple file upload page that works by:

?php
if ($HTTP_POST_VARS['submit'] == submit) {
  then upload the file...
}
?
Rest of document.

The form action returns to the same page (to allow you to upload another file).

This works fine, but if you press the refresh btn, the file keeps uploading pictures. 
If you click in the address bar  press return, this does not happen.

I have included the http headers to prevent caching as described in the 
documentation, but this hasn't seemed to work.

Is this a quirk of the browser/os combination or is there something i'm missing.

TIA

Roland


  



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




Re: [PHP] Caching Problem

2002-09-04 Thread Jed Verity

Oops. There was an extra period at the end there (after PHP_SELF).

?php
if ($HTTP_POST_VARS['submit'] == submit) {
then upload the file...
header(Location: http://.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
}
?

On the threshold of genius, Jed Verity wrote:

 Hi, Roland,
 
 There might be a better way to do this, but you could try to use the
 header() function after your upload takes place to redirect the browser to
 the same page, using GET. Something like...
 
 ?php
 if ($HTTP_POST_VARS['submit'] == submit) {
 then upload the file...
 header(Location: http://.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].);
 }
 ?
 
 Or something like that. HTH,
 Jed
 
 On the threshold of genius, Roland Swingler wrote:
 
 Hi
 
 I have a problem with caching on IE 5.1.4 on Mac Os X. (PHP 4.0.5)
 
 The page I want to use is a simple file upload page that works by:
 
 ?php
 if ($HTTP_POST_VARS['submit'] == submit) {
 then upload the file...
 }
 ?
 Rest of document.
 
 The form action returns to the same page (to allow you to upload another
 file).
 
 This works fine, but if you press the refresh btn, the file keeps uploading
 pictures. If you click in the address bar  press return, this does not
 happen.
 
 I have included the http headers to prevent caching as described in the
 documentation, but this hasn't seemed to work.
 
 Is this a quirk of the browser/os combination or is there something i'm
 missing.
 
 TIA
 
 Roland
 
 


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




[PHP] caching dynamic thumbnail

2002-07-10 Thread Roger Thomas

just would like to confirm here whether thumbnail images that i generated
dynamically with gd is cached by browsers.

a) i have a html frontend to call the php script that does that thumbnail. this
html file, say, view.htm contains these lines:

html
img src=thumb.php?image=../images/001.jpgx=150resize=1
/html


b) the thumbnailing works perfectly. but is this thumbnail cached inside my
browser. how do i find this out ?

c) if the answer to question b) above is 'No', is it a good idea to generate
thumbnails dynamically but PHYSICALLY writing it to disk (with extra checking
of course; is the thumb previously was available, is it the desired size etc
etc)

please advise.

--
roger


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




[PHP] Caching problem...?

2002-03-23 Thread Adam Schlag

Hello, I'm having a problem with my Apache/PHP setup.  I create a PHP
page and test it in a browser, and the page loads and everything is
fine.  However, when I make a change to my PHP script and reload the
page to see my changes, the same output from PHP is given to me.  I have
to save the page as a new file and load the new file to see any
changes.  I've turned off caching in my browser (Mozilla) and I've even
closed the browser and reloaded it, and I get the same page.  The only
thing that works is restarting Apache.

I'm running Debian with the Debian packages for Apache (1.3.23) and PHP
(4.1.2).  I've tried looking at the configuration and I know there has
to be an easy answer, but I can't find it.  I've read the documentation
for both, and I've searched the web for answers, but I just don't know
what's going on here.  Any help someone could provide would be greatly
appreciated.  Thank-you.

Adam Schlag





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




[PHP] Caching Problem

2002-03-06 Thread Paul A. Procacci

Hey all,
 I'm trying not to cache a page.  I have the following code:

$return = split( , exec(vmstat));
$cpu_top = 100;
$return = $cpu_top - $return[count($return) -1];

which returns the amount of idle cpu time.  The problem is this, every 
time the page is loaded, it always show the first value when the page 
was first loaded.   I tried adding :

header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
header(Pragma: no-cache);


all randomly, and together, but nothing seems to work.  I can run one of 
my binaries in a forever loop causing the cpu not ever to be idle, but 
still nothing.  Help?

Thanks in advance,
Paul


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




[PHP] Caching in php?

2002-02-06 Thread Erick Papadakis

hello, 

i used asp and it seems there is an application object
which can help in caching of data. (e.g.,
http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=142).


is this possible using php? what can i do to use
caching on my website which is totally database
driven?

thanks/erick

__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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




Re: [PHP] Caching in php?

2002-02-06 Thread Wolfram Kriesing

 is this possible using php? what can i do to use
 caching on my website which is totally database
 driven?

try PEAR::Cache
http://pear.php.net

-- 
Wolfram

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




Re: [PHP] Caching in php?

2002-02-06 Thread Jeff Bearer

There is Zend Cache, it expensive and you have to pay per processor.
That drove folks to develop APC (Alternitive PHP Cache) which is open
source. http://apc.communityconnect.com/

They take the PHP source and compile it into machine code and stores
that code, which saves porcessor overhead when the page is loaded again.

APC worked well for me, but that's not where my bottleneck is, mine is
with database access so I wanted to cache database queries.  I couldn't
find any application that did what I wanted so I wrote a class that
handles caching queries.  

In programming it I wanted it to be a transparent as possible and make
using it just like using the PEAR mysql module so I could add it to my
site with minor modifications.  

Here is a little on how it works.  It checks to see if the query is
cached, if not it queries the database.  It takes the data returned from
the query and stores it in a xml file, which I have on a RAM disk for
speed.  It returns a result object similiar to the result object from
the PEAR mysql stuff.  And that object has a FetchRow function just like
the mysql result object so it drops right into existing code.

It's new and I haven't truely tested it's proformance yet but if you are
interested in it. Let me know, I'm positive that people will be able to
improve the code in the class which would be cool.

 

On Wed, 2002-02-06 at 09:23, Erick Papadakis wrote:
 hello, 
 
 i used asp and it seems there is an application object
 which can help in caching of data. (e.g.,
 http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=142).
 
 
 is this possible using php? what can i do to use
 caching on my website which is totally database
 driven?
 
 thanks/erick
 
 __
 Do You Yahoo!?
 Send FREE Valentine eCards with Yahoo! Greetings!
 http://greetings.yahoo.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Jeff Bearer, RHCE
Webmaster
PittsburghLIVE.com


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




[PHP] caching madness

2001-09-20 Thread Christian Haines

hi all,

i have tried everything not to get a page to cache..

server-side:

  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  header('Last-Modified: '. gmdate('D, d M Y H:i:s') .' GMT');
  header('Cache-Control: no-cache, must-revalidate');
  header('Pragma: no-cache')

client-side:

meta http-equiv = Expires content = Tue, 20 Aug 1996 14:25:27 GMT


does anyone have any idea how to make sure pages do not cache?


many thanks in advance,
christian


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] caching and IE 5

2001-08-09 Thread Karl Phillipson

Is anyone else having fun and games with IE 5.0 and caching?

I have the no-cache code (below) before anything else in my index file. 
Following that an include file is pulled in that has a form with a text
input field that echos the date and time.

Whenever I refresh the page the time does not update to reflect the current
time, it sticks with the time that was displayed when the page was first
loaded.
Even when I close the browser and reopen it the time remains the same. Any
pointers on this issue?

?php
header (Expires: Mon, 14 Jul 1963 05:00:00 GMT);// Date in the past
header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); // always
modified
header (Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
header (Pragma: no-cache);
?


input type=text name=search_name value=?php echo SEARCH
.date(F jS Y G:m A) ?

Thx in advance.

Karl





Re: [PHP] caching and IE 5

2001-08-09 Thread Daniel James

On Thu, 9 Aug 2001, Karl Phillipson wrote:

 Is anyone else having fun and games with IE 5.0 and caching?
 
 I have the no-cache code (below) before anything else in my index file. 
 Following that an include file is pulled in that has a form with a text
 input field that echos the date and time.
 
 Whenever I refresh the page the time does not update to reflect the current
 time, it sticks with the time that was displayed when the page was first
 loaded.
 Even when I close the browser and reopen it the time remains the same. Any
 pointers on this issue?
 
 ?php
 header (Expires: Mon, 14 Jul 1963 05:00:00 GMT);// Date in the past
 header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); // always
 modified
 header (Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
 header (Pragma: no-cache);
 ?
 
 
   input type=text name=search_name value=?php echo SEARCH
 .date(F jS Y G:m A) ?
 
 Thx in advance.
 
 Karl
 

I do something messy when nothing else works... get ready for it hehe

a href=?=$PHP_SELF??iesux=?=rand(10,20)?Click here to refresh/a

Told you it was ugly.

Twigman...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] caching and IE 5

2001-08-09 Thread Lawrence . Sheed

Try this

head
META Http-Equiv=Cache-Control Content=no-cache
META Http-Equiv=Pragma Content=no-cache
META Http-Equiv=Expires Content=0 
/head

works for me  - try loading www.shanghaiguide.com/main/index.php3 - should
do time, and display a different image every time.

cheers,

lawrence.
-Original Message-
From: Karl Phillipson [mailto:[EMAIL PROTECTED]]
Sent: August 9, 2001 5:21 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] caching and IE 5


Is anyone else having fun and games with IE 5.0 and caching?

I have the no-cache code (below) before anything else in my index file. 
Following that an include file is pulled in that has a form with a text
input field that echos the date and time.

Whenever I refresh the page the time does not update to reflect the current
time, it sticks with the time that was displayed when the page was first
loaded.
Even when I close the browser and reopen it the time remains the same. Any
pointers on this issue?

?php
header (Expires: Mon, 14 Jul 1963 05:00:00 GMT);// Date in the past
header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); // always
modified
header (Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
header (Pragma: no-cache);
?


input type=text name=search_name value=?php echo SEARCH
.date(F jS Y G:m A) ?

Thx in advance.

Karl



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] caching and IE 5

2001-08-09 Thread Karl Phillipson

Hmmm, I substituted the date(F jS Y G:m A) function for a time() function
and this works fine, on refresh the updated timestamp is visible. 

(btw system is apache 1.20 running on Hed Rat 7.1 - php 4.05)

Can anyone explain why the time() function refreshes and returns the correct
value but the date(F jS Y G:m A) does not??

Seems the problem might not be an IE5 caching issue at all ??

Regs,

Karl



==
Karl Phillipson
PHP SQL Programmer

Saffron Hill Ventures
67 Clerkenwell Road
London   
EC1R 5BL

Saffron Hill: 0207 693 8300
Direct Line: 0207 693 8318


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 10:37
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] caching and IE 5


Try this

head
META Http-Equiv=Cache-Control Content=no-cache
META Http-Equiv=Pragma Content=no-cache
META Http-Equiv=Expires Content=0 
/head

works for me  - try loading www.shanghaiguide.com/main/index.php3 - should
do time, and display a different image every time.

cheers,

lawrence.
-Original Message-
From: Karl Phillipson [mailto:[EMAIL PROTECTED]]
Sent: August 9, 2001 5:21 PM
To: '[EMAIL PROTECTED]'
Subject: [PHP] caching and IE 5


Is anyone else having fun and games with IE 5.0 and caching?

I have the no-cache code (below) before anything else in my index file. 
Following that an include file is pulled in that has a form with a text
input field that echos the date and time.

Whenever I refresh the page the time does not update to reflect the current
time, it sticks with the time that was displayed when the page was first
loaded.
Even when I close the browser and reopen it the time remains the same. Any
pointers on this issue?

?php
header (Expires: Mon, 14 Jul 1963 05:00:00 GMT);// Date in the past
header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT); // always
modified
header (Cache-Control: no-cache, must-revalidate);  // HTTP/1.1
header (Pragma: no-cache);
?


input type=text name=search_name value=?php echo SEARCH
.date(F jS Y G:m A) ?

Thx in advance.

Karl



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] caching

2001-07-04 Thread Jon Yaggie

It seems still not to work.

i have tried all the header options mentioned. adding a query string is out of the 
option I am using javascript and it dont like that stuff.   and my browser still 
caches everything and drives me nuts.  maybe i am putting it in the wrong file?  but i 
really cant imagine what other file it should be in.  the set up is like this.

I have button.php which is just a function that creates and image and save it to a 
file.  and then mypage.php that uses this function to generate a menu and then one 
include to header.html which contains the actual menu and calls to the images saved.  
I placed the headers at the top of mypage.php.  where else could i put them?  and my 
browser still caches unless i conpletely turn off caching.



What am i doing wrong?




Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0

this code works good...

Place this code at the top of the files where you want then to always
refresh i.e. no cache

 header (Pragma: no-cache);
 header (Cache-Control: no-cache, must-revalidate, max_age=0);
 header (Expires: 0);

Have fun
Kevin
- Original Message -
From: Jon Yaggie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 30, 2001 4:36 PM
Subject: [PHP] caching


Ok I am dynamically creating images.  my problem is my browser is caching
the images (or at least half ot them - i see no particular system to which)
i have no idea how to stop this.  i have tried using the header
Cache-Control: no-cahe  However it seems to have no helped.  maybe i am
using it wrongly?  is there another method i can clear the browser cache?




Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0


this code works good...

Place this code at the top of the files where you want then to always
refresh i.e. no cache

 header (Pragma: no-cache);
 header (Cache-Control: no-cache, must-revalidate, max_age=0);
 header (Expires: 0);

Have fun
Kevin
- Original Message -
From: Jon Yaggie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 30, 2001 4:36 PM
Subject: [PHP] caching


Ok I am dynamically creating images.  my problem is my browser is caching
the images (or at least half ot them - i see no particular system to which)
i have no idea how to stop this.  i have tried using the header
Cache-Control: no-cahe  However it seems to have no helped.  maybe i am
using it wrongly?  is there another method i can clear the browser cache?




Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0






AW: [PHP] caching

2001-07-03 Thread Sebastian Stadtlich

you could attach a random number as a get parameter

img src=test.php?nothing=2637846294626378264

that image would hardly ever be cached...

sebastian

 -Ursprüngliche Nachricht-
 Von: Jon Yaggie [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 31. Mai 2001 00:36
 An: [EMAIL PROTECTED]
 Betreff: [PHP] caching
 
 
 Ok I am dynamically creating images.  my problem is my 
 browser is caching the images (or at least half ot them - i 
 see no particular system to which)  i have no idea how to 
 stop this.  i have tried using the header Cache-Control: 
 no-cahe  However it seems to have no helped.  maybe i am 
 using it wrongly?  is there another method i can clear the 
 browser cache?
 
 
 
 
 Thank You,
  
 Jon Yaggie
 www.design-monster.com
  
 And they were singing . . . 
  
 '100 little bugs in the code
 100 bugs in the code
 fix one bug, compile it again
 101 little bugs in the code
  
 101 little bugs in the code . . .'
  
 And it continued until they reached 0
 
 
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] caching

2001-07-03 Thread Jay Paulson

This is what I use for the header information.. I don't know if it will work
for an image or not but it works nicely for text fields that are dynamically
populated.. anyway if you aren't adding this extra little bit at the end of
the header function you might want to give it a shot...

header (Cache-Control: no-cache, must-revalidate);

Jay Paulson
Internet Program Director
LBJS
[EMAIL PROTECTED]

- Original Message -
From: Jon Yaggie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 30, 2001 5:36 PM
Subject: [PHP] caching


Ok I am dynamically creating images.  my problem is my browser is caching
the images (or at least half ot them - i see no particular system to which)
i have no idea how to stop this.  i have tried using the header
Cache-Control: no-cahe  However it seems to have no helped.  maybe i am
using it wrongly?  is there another method i can clear the browser cache?




Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] caching

2001-06-30 Thread Jon Yaggie

Ok I am dynamically creating images.  my problem is my browser is caching the images 
(or at least half ot them - i see no particular system to which)  i have no idea how 
to stop this.  i have tried using the header Cache-Control: no-cahe  However it seems 
to have no helped.  maybe i am using it wrongly?  is there another method i can clear 
the browser cache?




Thank You,
 
Jon Yaggie
www.design-monster.com
 
And they were singing . . . 
 
'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code
 
101 little bugs in the code . . .'
 
And it continued until they reached 0





[PHP] Caching Authentification

2001-04-28 Thread Steve Haemelinck

Hi all

I use sessions the authenticate users, but I seem to have a problem.
This is what happens:

1) A user logs in on PC one with his username and password. (So far so good)
2) Another user logs in with his details on the same computer -- He is
logged in with his details but the page displayed is the one of the other
user unless he refreshes the page.

I thought this was because the page might be cached, but when I set the
header(cache-control: no-cache)  the meta tag http-equiv=Expires
content=-1 it still produces the same effect.
How can I solve this problem?

Haemelinck Steve

Personal:
Haemelinck.be - Developers Unite :)
Junior WebDeveloper
http://www.haemelinck.be:8080/
[EMAIL PROTECTED]

Work:
MCT IT Consulting - Take consulting 2 the next level
Junior IT Consultant
http://www.mct.be/
[EMAIL PROTECTED]



Haemelinck Steve

Personal:
Haemelinck.be - Developers Unite :)
Junior WebDeveloper
http://www.haemelinck.be:8080/
[EMAIL PROTECTED]

Work:
MCT IT Consulting - Take consulting 2 the next level
Junior IT Consultant
http://www.mct.be/
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]