RE: [PHP] Cache engines in a multi-tenant environment (a bit long)

2009-03-03 Thread Damon Miller
On Tue, 2009-03-03 at 14:52 -0500, Robert Cummings wrote:
> >
> > My question then becomes the following:  Is there a cache engine
> > available which can store multiple (different) copies of a source
file
> > and serve them only to the appropriate request?  Perhaps a better
way
> > to describe this would be a sort of "mapping" feature allowing
> > per-directory control.  I'm imagining a simple list of directories
> > that instructs the cache engine to keep their caches separate.  This
might
> > even be implemented by incorporating the directory name into the key
> > used for lookups, but frankly I haven't spent much time looking at
> > APC's code (nor have I looked at XCache's or eAccelerator's at all.)
> 
> If the path to the source file differs then it shouldn't matter that
the
> source tree is a copy, for all intents and purposes, as far as an
> accelerator is concerned, the sources are different. I've not liked
APC
> in the past (I don't remember exactly what the problem was) and
> personally use eAccelerator.
> 
> Cheers,
> Rob.

Rob,

Thanks very much for your response.  I was surprised at APC's behavior
(thinking that files in different directories would be treated as
different entities) but I couldn't explain the behavior I was seeing
otherwise.  However, that may be a function of APC specifically and not
all PHP cache engines.  I'll spend some time with eAccelerator and
hopefully it will work as expected.

Thanks again,

Damon


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



Re: [PHP] Cache engines in a multi-tenant environment (a bit long)

2009-03-03 Thread Robert Cummings
On Tue, 2009-03-03 at 11:41 -0800, Damon Miller wrote:
>
> My question then becomes the following:  Is there a cache engine
> available which can store multiple (different) copies of a source file
> and serve them only to the appropriate request?  Perhaps a better way
> to
> describe this would be a sort of "mapping" feature allowing
> per-directory control.  I'm imagining a simple list of directories
> that
> instructs the cache engine to keep their caches separate.  This might
> even be implemented by incorporating the directory name into the key
> used for lookups, but frankly I haven't spent much time looking at
> APC's
> code (nor have I looked at XCache's or eAccelerator's at all.)

If the path to the source file differs then it shouldn't matter that the
source tree is a copy, for all intents and purposes, as far as an
accelerator is concerned, the sources are different. I've not liked APC
in the past (I don't remember exactly what the problem was) and
personally use eAccelerator.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



[PHP] Cache engines in a multi-tenant environment (a bit long)

2009-03-03 Thread Damon Miller
Hi all.  I need some guidance on implementing a PHP cache engine in a
"multi-tenant" environment.  I've done some research on the open-source
cache engines available--specifically, APC, XCache, and
eAccelerator--but I haven't found anything that speaks to my use case.
Hopefully someone will be able to point me in the right direction.


Here's the basic use case:  I've got multiple instances of one PHP
application running on a single server.  This is accomplished in a
fairly straightforward manner:  We just create multiple copies of the
application on the filesystem.  It looks something like this:

/var/www/html/abc
/var/www/html/def
/var/www/html/ghi

Etc.


Each of the directories above ('abc', 'def', and 'ghi') contains a
complete copy of the PHP applicationwith slight variations based on
customer need.  Examples of these differences are LDAP parameters,
layout customizations, field names, etc.  Note that these variations
often occur in the PHP code, i.e. there will be multiple occurrences of
file "ldap.php" 


This works without incident but due to increasing adoption, performance
has become an issue.  In an attempt to improve performance, I
implemented APC.  This resulted in a significant performance gain, but
after several days we noticed intermittent problems that clearly
indicated one instance's code was being "leaked" to another instance.
As a specific example, we began seeing one customner's layout changes in
another instance.  These were quite obvious in that a field bearing the
wrong company name suddenly appeared.


After ruling out obvious filesystem mistakes I was forced to conclude
that the cache engine was serving the "wrong" version of a file.  I
enclose that in quotes because APC may technically doing the right
thing; given multiple copies of the same source file--as would
frequently occur in our environment--it cached the latest one and served
it up as requested.  However, this behavior is not compatible with our
hosting approach.


My question then becomes the following:  Is there a cache engine
available which can store multiple (different) copies of a source file
and serve them only to the appropriate request?  Perhaps a better way to
describe this would be a sort of "mapping" feature allowing
per-directory control.  I'm imagining a simple list of directories that
instructs the cache engine to keep their caches separate.  This might
even be implemented by incorporating the directory name into the key
used for lookups, but frankly I haven't spent much time looking at APC's
code (nor have I looked at XCache's or eAccelerator's at all.)


Thanks in advance for any guidance.



Regards,

Damon

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



RE: [PHP] PHP Cache (was PHP load to high on server)

2006-01-19 Thread Richard Lynch
On Thu, January 19, 2006 12:56 am, Albert wrote:
> Jochem Maas wrote:
>> take note that APC does 2 things:
>>
>> 1. op code caching
>> 2. manage some shared memory (a central place where you can stick
>> stuff
>> that needs to be read again and again and again; but doesn't need
>> updating
>> very often)
>
> "pear install apc" failed without reason. I ended up downloading the
> package
> and building it manually.
>
> I opened my login page (worked fine) and then logged in only to get a
> "Cannot find server". I had to restart Apache to get any other page
> out.
>
> On inspection of the Apache error log I saw:
> [Thu Jan 19 06:47:49 2006] [notice] child pid 16429 exit signal
> Segmentation
> fault (11)
>
> I have Zend Optimizer installed as well. When disabled Zend Optimizer
> my
> server works correctly. When Zend Optimizer is enabled then I get the
> segfaults.
>
> It seems that APC and Zend Optimizer does not work together so I
> cannot use
> APC as some of the modules we use from third party suppliers have been
> encoded with Zend Safeguard.

You *MIGHT* be able to segregate the Zend-encoded files from the image
files, on sub-domains or separate servers, and then you could
configure one to use Zend Optimizer, and the other to use APC...

Just an idea.  Not sure it's workable in your situation.

-- 
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] PHP Cache (was PHP load to high on server)

2006-01-19 Thread Albert
Jochem Maas wrote:
> take note that APC does 2 things:
>
> 1. op code caching
> 2. manage some shared memory (a central place where you can stick stuff
> that needs to be read again and again and again; but doesn't need updating
> very often)

"pear install apc" failed without reason. I ended up downloading the package
and building it manually.

I opened my login page (worked fine) and then logged in only to get a
"Cannot find server". I had to restart Apache to get any other page out.

On inspection of the Apache error log I saw:
[Thu Jan 19 06:47:49 2006] [notice] child pid 16429 exit signal Segmentation
fault (11)

I have Zend Optimizer installed as well. When disabled Zend Optimizer my
server works correctly. When Zend Optimizer is enabled then I get the
segfaults.

It seems that APC and Zend Optimizer does not work together so I cannot use
APC as some of the modules we use from third party suppliers have been
encoded with Zend Safeguard.

Albert

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.20/234 - Release Date: 2006/01/18
 

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



Re: [PHP] PHP Cache (was PHP load to high on server)

2006-01-18 Thread Ruben Rubio Rey

Did u tried memcached? http://www.danga.com/memcached/


Albert wrote:


I wrote:
 


I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP
4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine 
is used for testing. We have made some changes to our PHP application and 
now the machine is having trouble serving the pages. Apache is occupying 
almost 90% CPU usage.
   



I have resolved this issue by removing a piece of code which reads a set of
parameters from a database. It seems that the hard disk on the machine is
quite slow, slowing down all database access with it...

I now check if the parameters are set in the session, if it is I use them
otherwise I read them from the database and save it as session variables.
When it changes I simply remove it from the session so it forces an update.
So far it is working quite well.

I now want to go and take all the static stuff that the user will configure
once in a life time and put it in the session and only update it when it
changes instead of reading it from the database every five seconds or so.

For this I don't want to use a disk based session handler. I want the
session variables to remain in memory (about 20KB per user) as to speed up
the whole process. 


I also want an opcode cache to cache the compiled pages on the server in an
attempt to speed up the HTTP server.

For this I wanted to use mmCache (actually I want to use Zend Performance
Suite but first I need to prove that it is worth $ 1000 per CPU and from the
stats on the mmCache site mmCache is faster...) but it seems that the
mmCache project has been abandoned as there have been no work done on it
since 2003.

Can someone confirm this or recommend an alternate cache (doesn't have to be
free but should break the bank) which will do what I want? 


Albert

 



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



RE: [PHP] PHP Cache (was PHP load to high on server)

2006-01-18 Thread Richard Lynch
On Wed, January 18, 2006 9:37 am, Albert wrote:
> For this I wanted to use mmCache (actually I want to use Zend
> Performance
> Suite but first I need to prove that it is worth $ 1000 per CPU and
> from the
> stats on the mmCache site mmCache is faster...) but it seems that the
> mmCache project has been abandoned as there have been no work done on
> it
> since 2003.

Errr.

I wouldn't really trust stats on mmCache site saying mmCache is
faster, unless you can corraborate them with independent unbiased
sources.

Ditto for stats on Zend site!

More importantly, you can still (I assume) try the Zend Cache for free
for 30 days or whatever it is.

Prediction:
Zend Cache will probably at least double the overall speed of your
application.

There are MANY factors that go into that prediction, and your PHP
usage may be anamolous in some way I'm missing.  But for what you
describe, I'm predicting 200% performance improvement.

YMMV

NAIAA

IANAL

-- 
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] PHP Cache (was PHP load to high on server)

2006-01-18 Thread Stefan Moldoveanu


http://eaccelerator.net/HomeUk
Actually, is the former mmCache with a new team of developers and some 
impovements.
The last known version of mmCache I've played with one week ago core dumped the 
httpd on ./apachectl stop.
The last stable version of eAccelerator (0.9.3, I think) works like a charm 
with PHP 4.4.2 / Apache 1.3.4

Stefan

Albert wrote:


I also want an opcode cache to cache the compiled pages on the server in an
attempt to speed up the HTTP server.

For this I wanted to use mmCache (actually I want to use Zend Performance
Suite but first I need to prove that it is worth $ 1000 per CPU and from the
stats on the mmCache site mmCache is faster...) but it seems that the
mmCache project has been abandoned as there have been no work done on it
since 2003.

Can someone confirm this or recommend an alternate cache (doesn't have to be
free but should break the bank) which will do what I want? 


Albert



Re: [PHP] PHP Cache (was PHP load to high on server)

2006-01-18 Thread Jochem Maas

on your *nix cmdline type this:

pear install apc

(if you don't have pear installed then you should fix that first ;-)
now read here about how to use it:

http://php.net/apc

I love it even though it crashes when caching the opcodes of certain
class files (php5 files that make use of __get()/__set() to retrieve
[sub-]objects).

take note that APC does 2 things:

1. op code caching
2. manage some shared memory (a central place where you can stick stuff
that needs to be read again and again and again; but doesn't need updating
very often)

by all means come back if you get stuck or have specific issues ( I can't
garantee I will be able to help - I'm only a little further down the apc road
than you**)

rgds,
Jochem

** the internals mailing list archive can attest to the ammount of
times I have badgered Rasmus about APC ;-) (Rasmus cowrote APC btw)

Albert wrote:

I wrote:


I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP
4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine 
is used for testing. We have made some changes to our PHP application and 
now the machine is having trouble serving the pages. Apache is occupying 
almost 90% CPU usage.



I have resolved this issue by removing a piece of code which reads a set of
parameters from a database. It seems that the hard disk on the machine is
quite slow, slowing down all database access with it...

I now check if the parameters are set in the session, if it is I use them
otherwise I read them from the database and save it as session variables.
When it changes I simply remove it from the session so it forces an update.
So far it is working quite well.

I now want to go and take all the static stuff that the user will configure
once in a life time and put it in the session and only update it when it
changes instead of reading it from the database every five seconds or so.

For this I don't want to use a disk based session handler. I want the
session variables to remain in memory (about 20KB per user) as to speed up
the whole process. 


I also want an opcode cache to cache the compiled pages on the server in an
attempt to speed up the HTTP server.

For this I wanted to use mmCache (actually I want to use Zend Performance
Suite but first I need to prove that it is worth $ 1000 per CPU and from the
stats on the mmCache site mmCache is faster...) but it seems that the
mmCache project has been abandoned as there have been no work done on it
since 2003.

Can someone confirm this or recommend an alternate cache (doesn't have to be
free but should break the bank) which will do what I want? 


Albert



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



RE: [PHP] PHP Cache (was PHP load to high on server)

2006-01-18 Thread Albert
I wrote:
> I am running SuSE 9.2 (Kernel 2.6.8-24-default) with Apache 2.0.50 and PHP
> 4.3.8 (as an Apache module) on a Celeron 900 with 304MB RAM. This machine 
> is used for testing. We have made some changes to our PHP application and 
> now the machine is having trouble serving the pages. Apache is occupying 
> almost 90% CPU usage.

I have resolved this issue by removing a piece of code which reads a set of
parameters from a database. It seems that the hard disk on the machine is
quite slow, slowing down all database access with it...

I now check if the parameters are set in the session, if it is I use them
otherwise I read them from the database and save it as session variables.
When it changes I simply remove it from the session so it forces an update.
So far it is working quite well.

I now want to go and take all the static stuff that the user will configure
once in a life time and put it in the session and only update it when it
changes instead of reading it from the database every five seconds or so.

For this I don't want to use a disk based session handler. I want the
session variables to remain in memory (about 20KB per user) as to speed up
the whole process. 

I also want an opcode cache to cache the compiled pages on the server in an
attempt to speed up the HTTP server.

For this I wanted to use mmCache (actually I want to use Zend Performance
Suite but first I need to prove that it is worth $ 1000 per CPU and from the
stats on the mmCache site mmCache is faster...) but it seems that the
mmCache project has been abandoned as there have been no work done on it
since 2003.

Can someone confirm this or recommend an alternate cache (doesn't have to be
free but should break the bank) which will do what I want? 

Albert

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.20/233 - Release Date: 2006/01/18
 

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



Re: [PHP] cache xml objects in php5

2005-09-27 Thread Jasper Bryant-Greene

Rasmus Lerdorf wrote:


Jasper Bryant-Greene wrote:

Have you looked at memcache?
http://www.php.net/manual/en/ref.memcache.php


He did say that serialization wasn't an option and you can't use memcached 
without serializing.  You may not realize you are serializing, but the memcache

extension serializes internally.  There was also no mention of needing to cache
across servers here.


My bad. I didn't realise memcache serialised internally but now that I 
think about it, it kind of makes sense...



-Rasmus (attempting to use the new Yahoo! Mail webmail for php-general)


Any good? I've been using Gmail for webmail for a while now but have 
heard mixed things about Yahoo! Mail.


--
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] cache xml objects in php5

2005-09-27 Thread Rasmus Lerdorf
Kevin Wang wrote:
> My php5 web application needs to parse/marshall a bunch of large xml files 
> into
> php5 objects at the beginning of handling each request.  These xml files are
> static across all the requests and it is really time consuming to
> parse/marshall them into php5 objects.

What sort of PHP 5 objects?  Do you mean simplexml objects, or do you mean 
dom objects?

> I am wondering if there is any means to cache these xml objects so that each
> request will not go through the same time consuming xml parsing/building
> operation.  Serialization doesn't work in my case as deserialization is also
> very expensive.
> 
> I am using Apache as the web server.  What I am thinking is that if php5 
> allows
> us to keep certain objects (and their references) around across all the
> requests in a child process instead of cleaning all the object memory every
> time after a script/request is finished.

Generally the best way to do this is to parse the data down closer to its final 
usage.
Typically the final thing you need is not a simplexml or a dom object, what you 
really
need is structured data and this can typically be represented with an 
associative
array.  Once you have it down to an array, you can use pecl/apc and its 
apc_store()/
apc_fetch() functions to cache these in shared memory without the slowdown of 
serialization.  A decent example of this technique can be found in the little 
simple_rss
function I wrote a while ago which parses all sorts of RSS feeds into a nested 
array and
caches this final array in shared memory using APC.

There really is no decent way to cache an object in shared memory without 
serialization.
The simpler data types can however be cached with APC.  Making them persistent 
is also
a problem as it completely violates PHP's request sandbox concept.  If you 
really feel
you need this, write yourself a PHP extension and initialize these objects in 
your MINIT
hook so they only get loaded at server startup and they will be available for 
the life of
that process.  

Jasper Bryant-Greene wrote:
> Have you looked at memcache?
> http://www.php.net/manual/en/ref.memcache.php
>
> You install and run the memcached server (it can be on localhost for a 
> single server setup, or for many servers it can be shared if the 
> interconnects are fast enough). Then you can cache just about any PHP 
> variable, including objects, in memory.

He did say that serialization wasn't an option and you can't use memcached 
without serializing.  You may not realize you are serializing, but the memcache
extension serializes internally.  There was also no mention of needing to cache
across servers here.

-Rasmus (attempting to use the new Yahoo! Mail webmail for php-general)

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



Re: [PHP] cache xml objects in php5

2005-09-26 Thread Torgny Bjers
Kevin Wang wrote:

>Hi All,
>
>My php5 web application needs to parse/marshall a bunch of large xml files into
>php5 objects at the beginning of handling each request.  These xml files are
>static across all the requests and it is really time consuming to
>parse/marshall them into php5 objects.
>
>I am wondering if there is any means to cache these xml objects so that each
>request will not go through the same time consuming xml parsing/building
>operation.  Serialization doesn't work in my case as deserialization is also
>very expensive.
>
>I am using Apache as the web server.  What I am thinking is that if php5 allows
>us to keep certain objects (and their references) around across all the
>requests in a child process instead of cleaning all the object memory every
>time after a script/request is finished.
>
>I guess this problem is quite common for any large and complicated php
>applications.
>  
>

If I had XML files that large, I would either switch database engine to
MySQL or PostgreSQL since that way I can page/load the data quicker than
parsing an XML document, or, I would consider the following:

Does the XML data change a lot? If not, why not cache the actual HTML
output instead of the data? That way you get n number of HTML documents
instead of one dynamic script, these files would only change when the
XML file has a changed filemtime(), and, it's easier for the server to
handle the requests. Take a look at:

http://pear.php.net/manual/en/package.caching.cache-lite.php

Cache_Lite is actually quite powerful since it allows you to cache
either the entire finished output, or just a part of the site and render
that from cache until the data has changed.

You could write down a whole series of cached documents either from one
request, or by running a cron under Linux or scheduler task under
Windows, and one user wouldn't get the brute of the waiting time when it
renders the cached parts.

Just some ideas... I hope I helped somehow.

Warm Regards,
Torgny

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



Re: [PHP] cache xml objects in php5

2005-09-26 Thread Jasper Bryant-Greene

Kevin Wang wrote:

My php5 web application needs to parse/marshall a bunch of large xml files into
php5 objects at the beginning of handling each request.  These xml files are
static across all the requests and it is really time consuming to
parse/marshall them into php5 objects.

I am wondering if there is any means to cache these xml objects so that each
request will not go through the same time consuming xml parsing/building
operation.  Serialization doesn't work in my case as deserialization is also
very expensive.

I am using Apache as the web server.  What I am thinking is that if php5 allows
us to keep certain objects (and their references) around across all the
requests in a child process instead of cleaning all the object memory every
time after a script/request is finished.


Have you looked at memcache?
http://www.php.net/manual/en/ref.memcache.php

You install and run the memcached server (it can be on localhost for a 
single server setup, or for many servers it can be shared if the 
interconnects are fast enough). Then you can cache just about any PHP 
variable, including objects, in memory.


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



[PHP] cache xml objects in php5

2005-09-26 Thread Kevin Wang
Hi All,

My php5 web application needs to parse/marshall a bunch of large xml files into
php5 objects at the beginning of handling each request.  These xml files are
static across all the requests and it is really time consuming to
parse/marshall them into php5 objects.

I am wondering if there is any means to cache these xml objects so that each
request will not go through the same time consuming xml parsing/building
operation.  Serialization doesn't work in my case as deserialization is also
very expensive.

I am using Apache as the web server.  What I am thinking is that if php5 allows
us to keep certain objects (and their references) around across all the
requests in a child process instead of cleaning all the object memory every
time after a script/request is finished.

I guess this problem is quite common for any large and complicated php
applications.

Thanks.

-- Kevin




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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



Re: [PHP] Cache/Form Problem

2005-09-25 Thread Mikey

Peter Justus wrote:


Hi List

Not too sure if this is the right list to send to so forgive me for my
ignorance if it is incorrect.

My Question

I have a form which users need to fill out, (quite a lengthy one) it
consists of 5 or so pages with various questions on each!, the last page
submits the information and writes it to the MYSQL database.

My problem is that when they have say completed the first three or so
pages and they have to click on the browsers back button to check if
they have filled in all the right info and then click on forward again
to go to the original page from where they came, the information is lost
and they basically have to start from scratch. This is obviously most
annoying for them, is there a simple solution to this...

Is there something I need to change in my php.ini file
the site is hosted on a linux server running 


php-4.3.2-19
mysql-3.23.58-2.3
httpd-2.0.46-44

Regards & thanks in advance
Peter

 

Store the form information is session vars, and pre-fill the forms with 
those session vars when the page loads. e.g:





HTH,

Mikey

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



[PHP] Cache/Form Problem

2005-09-25 Thread Peter Justus
Hi List

Not too sure if this is the right list to send to so forgive me for my
ignorance if it is incorrect.

My Question

I have a form which users need to fill out, (quite a lengthy one) it
consists of 5 or so pages with various questions on each!, the last page
submits the information and writes it to the MYSQL database.

My problem is that when they have say completed the first three or so
pages and they have to click on the browsers back button to check if
they have filled in all the right info and then click on forward again
to go to the original page from where they came, the information is lost
and they basically have to start from scratch. This is obviously most
annoying for them, is there a simple solution to this...

Is there something I need to change in my php.ini file
the site is hosted on a linux server running 

php-4.3.2-19
mysql-3.23.58-2.3
httpd-2.0.46-44

Regards & thanks in advance
Peter

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



Re: [PHP] Cache Problems

2005-05-20 Thread Richard Lynch
On Fri, May 20, 2005 12:11 pm, Rahul S. Johari said:
> My whole Auto-Image verification application and has come to get stuck at
> the Cache in IE. It¹s working fine in Safari on Mac, but IE is picking up
> the image from the Cache no matter what. I¹ve tried the following:

Are you clearing out the cache after you add these headers?

Cuz, like, if it gets IN the cache, the new headers you send don't count,
cuz it never asks for them.

> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");

Send something in the past, but not that far...  It might decide to ignore
you if you lie that much.

> header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
> header("Cache-Control: no-store, no-cache, must-revalidate");
> header("Cache-Control: post-check=0, pre-check=0", false);

I think having too many of these is going to mess you up...

> header("Pragma: no-cache");
>
> Which I understood is to tell the browser not to load the page or it¹s
> images from the Cache.. But it still does. Nothing is working out. I don¹t
> know how to get that page to load fresh from the server and not IE¹s cache
> so it won¹t display the same Image over and over.

If you really want to guaranteee no cahing in all browsers for all time,
the random URL is the way to go.  It's a shame that browsers will ignore
the caching headers, but since they do, I don't feel guilty making them
suck down more images then they should.

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



[PHP] Cache Problems

2005-05-20 Thread Rahul S. Johari

Ave,

My whole Auto-Image verification application and has come to get stuck at
the Cache in IE. It¹s working fine in Safari on Mac, but IE is picking up
the image from the Cache no matter what. I¹ve tried the following:

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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

Which I understood is to tell the browser not to load the page or it¹s
images from the Cache.. But it still does. Nothing is working out. I don¹t
know how to get that page to load fresh from the server and not IE¹s cache
so it won¹t display the same Image over and over.

Any suggestions?

Thanks,
 
Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com



Re: [PHP] Cache

2005-05-17 Thread Rory Browne
> Probably, but not serializing at all, and stuffing the data directly into
> shared memory would perhaps be faster, at least as I vaguely understood
> the results of a thread on serialization on this very forum from a month
> or two ago.  (Check archives for "serialize" "shared memory" and "Rasmus
> Lerdorf" who weighed in with a succinct explanation of how to avoid
> serialization if that performance hit was really a problem (unlikely as
> that was))

You're looking for this topic:

From: Josh Whiting <[EMAIL PROTECTED]>
To: php-general@lists.php.net
Date: Jan 3, 2005 5:28 PM
Subject: [PHP] Persistent PHP web application?

and this response by Rasmus:

From: Rasmus Lerdorf <[EMAIL PROTECTED]>
To: Josh Whiting <[EMAIL PROTECTED]>
Cc: php-general@lists.php.net
Date: Jan 4, 2005 6:40 PM
Subject: Re: [PHP] Persistent PHP web application?

The important functions were apc_fetch(), and apc_store() IIRC.
> 
> --
> 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
> 
>

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



Re: [PHP] Cache

2005-05-16 Thread Evert | Rooftop

Rory Browne wrote:
Interesting idea. Using three identifiers, as a key.
md5() returns a 32 hex-digit value. That means that there are can only
be a maximum of 3.4 * 10^38 possible outcomes for the md5(). This
means that there there is a 1 in
340 chance of a collision between
filenames.
 

Thank you Rory, Richard and Jason you really helped me out.
grt,
Evert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Cache

2005-05-16 Thread Rory Browne
Interesting idea. Using three identifiers, as a key.
md5() returns a 32 hex-digit value. That means that there are can only
be a maximum of 3.4 * 10^38 possible outcomes for the md5(). This
means that there there is a 1 in
340 chance of a collision between
filenames.

You could reduce those odds by a factor of three, by md5()ing each id
seperately, and concat'ing the resultant md5files. Alternatively
depending on your filesystem and the length of identifiers, you could
simply concat, and urlencode the  identifier. You could have a heck of
a long filename though.

I'd suggest taking a look at at the DB abstraction functions. They
were designed for what you're doing.

On 5/16/05, Evert | Rooftop <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm developing a cache system. Which works in pseude code, like this:
> 
> class Cache {
> 
>   function Fetchdata($id1,$id2,$id3) {
> 
> $id = md5($id1 . $id2 . $id3);
> if ($this->DataIsExpired($id)) return false;
>else return unserialize(file_get_contents($id));
> 
>  }
> 
>  function storeData($data,$id1,$id2,$id3) {
> 
>$id = md5($id1 . $id2 . $id3);
>OpenTheFileAndWriteTheDataSerialized($data);
>  }
> 
> }
> 
> $id1 $id2 and $id3 are when they are combined unique
> 
> * Is there a chance of collision when MD5 is used on the id's and the
> ids are long strings
> * Is file_get_contents the fastest way to open the file?
> * Is serialize the fastest way to serialize ;) ?
> * Are there any other things I should consider? (I'm aware of
> file-locking issues, and have taken care of that)
> 
> regards,
> Evert
> 
> --
> 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] Cache

2005-05-16 Thread Richard Lynch
On Mon, May 16, 2005 12:09 pm, Evert | Rooftop said:
> $id1 $id2 and $id3 are when they are combined unique
>
> * Is there a chance of collision when MD5 is used on the id's and the
> ids are long strings

Yes.  I think it's like 1 in 2 billion odds.

If you can concatenate $id1$id2$id3 and get a guaranteed unique string,
why not just use that as your unique string?

There are, of course, several good reasons NOT do, which may or may not
apply to your case:

Exposing the id's would be a security flaw.

Concatenating all three id's isn't really unique, after all.  (EG all
three are integer IDs from MySQL.)

The concatenation of all three is WAY too long.

> * Is serialize the fastest way to serialize ;) ?

Probably, but not serializing at all, and stuffing the data directly into
shared memory would perhaps be faster, at least as I vaguely understood
the results of a thread on serialization on this very forum from a month
or two ago.  (Check archives for "serialize" "shared memory" and "Rasmus
Lerdorf" who weighed in with a succinct explanation of how to avoid
serialization if that performance hit was really a problem (unlikely as
that was))

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



[PHP] Cache

2005-05-16 Thread Evert | Rooftop
Hi,
I'm developing a cache system. Which works in pseude code, like this:
class Cache {
 function Fetchdata($id1,$id2,$id3) {
   $id = md5($id1 . $id2 . $id3);
   if ($this->DataIsExpired($id)) return false;
  else return unserialize(file_get_contents($id));
}
function storeData($data,$id1,$id2,$id3) {
  $id = md5($id1 . $id2 . $id3);
  OpenTheFileAndWriteTheDataSerialized($data);
}
}
$id1 $id2 and $id3 are when they are combined unique
* Is there a chance of collision when MD5 is used on the id's and the 
ids are long strings
* Is file_get_contents the fastest way to open the file?
* Is serialize the fastest way to serialize ;) ?
* Are there any other things I should consider? (I'm aware of 
file-locking issues, and have taken care of that)

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


[PHP] Cache control

2005-04-26 Thread William Stokes
Hello,
I have an web application that checks users rights to specific parts of the 
apllication at the beginning of each page. However I noticed, with the help 
of Jason Barnett, that opera caches pages locally and the users rights check 
fails. The application works fine with Firefox and IE. So I think I need to 
prevent the pages from beeing cached. How this can be done? I'm totally 
inexperinced with this stuff.

The authentication is a 2 part task. First the username and password are 
checked and the user is given or denied access. This works ok with every 
browser. But once inside the user access rights check to differt parts of 
the application fails because of the Opera cache.

Thanks
-Will

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



Re: [PHP] cache class

2005-03-22 Thread Jason Barnett
To add to the discussion: are you using anything like the Zend
performance cache?  MMTurck?  Smarty?  I ask because there are various
programs out there (some PHP-based, some not) that will cache PHP code.

--
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


RE: [PHP] cache class

2005-03-22 Thread Mike Johnson
From: Mister Jack [mailto:[EMAIL PROTECTED] 

> Hi,
> 
> I'm having a bit of a problem.
> I include a class in my script, the first time run fine, and then if I
> change anything in my class, changes are not reflected on the browser,
> it's like it's still the old class which is used. I've cleared the
> browser cache, force a pragma no-cache, but no, nothing do the trick.
> even if I do "return;" at the beginning of the method I called, it
> doesn't work... does someone have a clue about what is going on ?

Not to be a jerk and ask the obvious question, but are you editing the
right file and/or saving it to the right place?

I only ask because I've done that so many times it's not funny.   :)


-- 
Mike Johnson Smarter Living, Inc.
Web Developerwww.smartertravel.com
[EMAIL PROTECTED]   (617) 886-5539

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



[PHP] cache class

2005-03-22 Thread Mister Jack
Hi,

I'm having a bit of a problem.
I include a class in my script, the first time run fine, and then if I
change anything in my class, changes are not reflected on the browser,
it's like it's still the old class which is used. I've cleared the
browser cache, force a pragma no-cache, but no, nothing do the trick.
even if I do "return;" at the beginning of the method I called, it
doesn't work... does someone have a clue about what is going on ?

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



Re: [PHP] cache engine

2005-03-06 Thread Chris Smith
Evert - Rooftop Solutions wrote:
Mark Charette wrote:
Evert - Rooftop Solutions wrote:
I heard that shared memory is actually slower than writing and 
reading a file and it is not available on windows systems.

Hmmm ... that's an interesting thing you heard concerning shared 
memory. Care to share _who_ told you that?

I'd like to make sure I don't hire him/her in the future.
http://www.onlamp.com/pub/a/php/2001/10/11/pearcache.html
Check it out, is in old article, but it says "|shm| -- The |shm| 
container stores the cached data in the shared memory. Benchmarks 
indicate that the current implementation of this container is much 
slower than the |file| container."

It is a bit outdated, but I haven't seen any recent benchmarks.
They both scale differently - shm linearly considering it's IO bandwidth 
and latency is considerably higher and lower respectively.  The shm 
doesn't require a disk head to move around to get and save data to cache 
(majority writes if it's caching to disk as reads get done from kernel 
cache) which takes time.

shm will hold out a lot longer than files (I know from experience with 
SVR4 many eons ago).

Cheers,
Chris Smith
Ninja Labs
http://www.ninjalabs.co.uk/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] cache engine

2005-03-05 Thread Mark Charette
Evert - Rooftop Solutions wrote:
Check it out, is in old article, but it says "|shm| -- The |shm| 
container stores the cached data in the shared memory. Benchmarks 
indicate that the current implementation of this container is much 
slower than the |file| container."
Which, of course, is miles away from saying that shared memory is slower 
than the file system.

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


Re: [PHP] cache engine

2005-03-05 Thread Evert - Rooftop Solutions
Mark Charette wrote:
Evert - Rooftop Solutions wrote:
I heard that shared memory is actually slower than writing and 
reading a file and it is not available on windows systems.

Hmmm ... that's an interesting thing you heard concerning shared 
memory. Care to share _who_ told you that?

I'd like to make sure I don't hire him/her in the future.
http://www.onlamp.com/pub/a/php/2001/10/11/pearcache.html
Check it out, is in old article, but it says "|shm| -- The |shm| 
container stores the cached data in the shared memory. Benchmarks 
indicate that the current implementation of this container is much 
slower than the |file| container."

It is a bit outdated, but I haven't seen any recent benchmarks.
grt,
Evert
--
Rooftop Solutions - Web Applications on Demand
tel. (+31)628962319 fax. (+31)842242474
[EMAIL PROTECTED]
http://www.rooftopsolutions.nl
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] cache engine

2005-03-05 Thread James Williams
Mark Charette wrote:
Evert - Rooftop Solutions wrote:
I heard that shared memory is actually slower than writing and reading 
a file and it is not available on windows systems.

Hmmm ... that's an interesting thing you heard concerning shared memory. 
Care to share _who_ told you that?

I'd like to make sure I don't hire him/her in the future.
Mark C.
HaHa Burn!  so you're saying that this is *not* true.  I'm also 
interested in cacheing although I know nothing about it.  I'm making a 
forum and it's small size and fast processing times are it's forte, so a 
cache system would be awesome, I'm thinking about incorporating it with 
my simple templating class.

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


Re: [PHP] cache engine

2005-03-05 Thread Mark Charette
Evert - Rooftop Solutions wrote:
I heard that shared memory is actually slower than writing and reading a 
file and it is not available on windows systems.
Hmmm ... that's an interesting thing you heard concerning shared memory. 
Care to share _who_ told you that?

I'd like to make sure I don't hire him/her in the future.
Mark C.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] cache engine

2005-03-05 Thread Evert - Rooftop Solutions
Chris Smith wrote:
I have seen some people using stornig cached items in shared memory. 
This is explained in some detail here:

http://www.danga.com/memcached/
I heard that shared memory is actually slower than writing and reading a 
file and it is not available on windows systems.

There are PHP client APIs available.
Alternatively PEAR offers some interesting caching solutions although 
i have not investigated them thoroughly ( http://pear.php.net/ )

Caching brings all sorts of wierdness out in applications due to 
multiple states of data being present in different layers in a system, 
so be careful.

Thanks I will check it out.
Hope this helps,
Chris Smith
Ninja Labs
http://www.ninjalabs.co.uk/
greetings,
Evert
--
Rooftop Solutions - Web Applications on Demand
tel. (+31)628962319 fax. (+31)842242474
[EMAIL PROTECTED]
http://www.rooftopsolutions.nl
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] cache engine

2005-03-05 Thread Chris Smith
Evert - Rooftop Solutions wrote:
I have written an extensive web application frameworks, and I keep 
seeing my execution time and memory-usage growing. Right now it is not a 
problem, but before it get's out of hands I will need to create a good 
cache engine.
My cache engine requires that I can cache method results, based on 
multiple parameters. What would be a good way to implement this? I know 
this propably a well-formed question, but before I start, I want to be 
sure I'll do it the right way. Has anyone got any experience with this, 
or can anyone give me some pointers on where to start looking?
I have seen some people using stornig cached items in shared memory. 
This is explained in some detail here:

http://www.danga.com/memcached/
There are PHP client APIs available.
Alternatively PEAR offers some interesting caching solutions although i 
have not investigated them thoroughly ( http://pear.php.net/ )

Caching brings all sorts of wierdness out in applications due to 
multiple states of data being present in different layers in a system, 
so be careful.

Hope this helps,
Chris Smith
Ninja Labs
http://www.ninjalabs.co.uk/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] cache engine

2005-03-05 Thread Evert - Rooftop Solutions
Hi people,
I have written an extensive web application frameworks, and I keep 
seeing my execution time and memory-usage growing. Right now it is not a 
problem, but before it get's out of hands I will need to create a good 
cache engine.
My cache engine requires that I can cache method results, based on 
multiple parameters. What would be a good way to implement this? I know 
this propably a well-formed question, but before I start, I want to be 
sure I'll do it the right way. Has anyone got any experience with this, 
or can anyone give me some pointers on where to start looking?

thanks in forward,
Evert
--
Rooftop Solutions - Web Applications on Demand
tel. (+31)628962319 fax. (+31)842242474
http://www.rooftopsolutions.nl
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP Cache

2005-01-25 Thread Matthew Weier O'Phinney
* Merlin <[EMAIL PROTECTED]>:
> I am trying to find a open source PHP Cache extension. After trying
> out ionCube PHP Accelerator (http://www.php-accelerator.co.uk) I had
> to remove it from the system since it brought down the server every
> few weeks due to some memory leak.  There is also APC, but the latest
> build is over 3 years old.
>
> Is there a working alternative for Zend? I am not sure if it is worth
> for me to spend that much money for a lizence.

I haven't used it yet, but I've heard some good reports about it:

http://eaccelerator.sourceforge.net/Home

It's a fork of Turckk mmcache.

-- 
Matthew Weier O'Phinney   | mailto:[EMAIL PROTECTED]
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

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



Re: [PHP] PHP Cache

2005-01-25 Thread Tom
Squid any good to you? You can configure it to cache based on page name, 
GET and POST params (personally don't like to use POST params for static 
or semi static content, but that's a personal preference, not a hard and 
fast rule), farside domains
You set it up above your php servers so it doesn't care what language 
you are using to provide the content.

Tom
Merlin wrote:
Hi there,
I am trying to find a open source PHP Cache extension. After trying 
out ionCube PHP Accelerator (http://www.php-accelerator.co.uk) I had 
to remove it from the system since it brought down the server every 
few weeks due to some memory leak. There is also APC, but the latest 
build is over 3 years old.

Is there a working alternative for Zend? I am not sure if it is worth 
for me to spend that much money for a lizence.

Thank you for any suggestion.
Regards,
merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] PHP Cache

2005-01-25 Thread Merlin
Hi there,
I am trying to find a open source PHP Cache extension. After trying out ionCube 
PHP Accelerator (http://www.php-accelerator.co.uk) I had to remove it from the 
system since it brought down the server every few weeks due to some memory leak. 
There is also APC, but the latest build is over 3 years old.

Is there a working alternative for Zend? I am not sure if it is worth for me to 
spend that much money for a lizence.

Thank you for any suggestion.
Regards,
merlin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Cache

2004-08-17 Thread raditha dissanayake
Octavian Rasnita wrote:
From: "pan" <[EMAIL PROTECTED]>
 

What provides the new data?
Can you run a html update from whatever is supplying the new data?
   


Hmm, I don't think I can. The data is stored in MySQL by a separate program,
but that data can be used in more pages.
I think the only good solution would be to run a program that create a cache
for every page from that site.
This would not be very simple because the site could have more template
styles available for the users, and all the page could appear in more
languages, and some pages could be accessed from a form with many options,
etc.
It would not be very practicly to create such many cached pages.
I begin to think that it is not really possible to do what I want and I
guess that if the PHP program is well done, the speed difference would not
be too big.
 

that's usually the case some developers spend a lot of time chaning 
double quoates to single quotes all it get's them is a saving of 2 
milliseconds per script. However delivering static html instead of 
dynamic generated html will be faster under very high loads. So you may 
want to keep at it if you have a large site.
In a related thread i have posted about the use of squid i think you may 
want to look at it.

An approach that may work in your case is to host the scripts on a 
private ip and use wget to 'download' the entire site on to the htdoc 
folder of your public site. wget could be invoked by the same program 
that inserts the data into the db.

finally media wiki (the software that powers wikipedia.org ) has a good 
caching mechanism which you might want to look at.


Teddy
 


--
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] Cache

2004-08-17 Thread Octavian Rasnita
From: "pan" <[EMAIL PROTECTED]>


> What provides the new data?
> Can you run a html update from whatever is supplying the new data?
>


Hmm, I don't think I can. The data is stored in MySQL by a separate program,
but that data can be used in more pages.
I think the only good solution would be to run a program that create a cache
for every page from that site.
This would not be very simple because the site could have more template
styles available for the users, and all the page could appear in more
languages, and some pages could be accessed from a form with many options,
etc.
It would not be very practicly to create such many cached pages.

I begin to think that it is not really possible to do what I want and I
guess that if the PHP program is well done, the speed difference would not
be too big.

Teddy

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



Re: [PHP] Cache

2004-08-16 Thread pan
> >The problem is that I don't know how to automaticly decide when it is the
> >right moment to update the cache and this is very important.
> >I get some data from a database and the PHP program doesn't know when the
> >database gets updated by another program, so it cannot create the cache
for
> >that page immediately.

What provides the new data?
Can you run a html update from whatever is supplying the new data?

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



Re: [PHP] cache was:Re: Compile

2004-08-16 Thread raditha dissanayake
Gentlemen,
After some study I am very confident that the best solution is to use 
squid accelarator rather with out with out any of these caching programs.

The ideas is this you can run squid 'in front of' your webserver and it 
will cache the generated html output from the php script and deliver 
that to the client. The difference here is that the turck et al caches 
the compiled php script - it still has to be executed which takes up a 
bit more memory and CPU.

Of course this cached html output will not work for all your scripts - 
in such cases you can edit squid.conf to pass the request direct to the 
script.


--
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] Cache

2004-08-16 Thread raditha dissanayake
Octavian Rasnita wrote:
Hi all,
I want to create an html cache of a page, like when that page is saved to
the disk and let the visitors download that static page and not a dynamic
one.
Of course, a dynamic PHP program will load that static page and display it,
but without need to connect to databases, to make calculations, etc.
The problem is that I don't know how to automaticly decide when it is the
right moment to update the cache and this is very important.
I get some data from a database and the PHP program doesn't know when the
database gets updated by another program, so it cannot create the cache for
that page immediately.
If I let the program check the database each time it is ran, this takes some
times, and it is like I would not use the cache at all.
Is it possible to use that kind of cache I want? (meaning... a kind of
static page saved).
 

Your exact requirement is pretty hard to match but torsten has made a 
good suggestion. I would suggest you use squid cache in httpd 
accelarator mode.

With either of these solutions you might still want to install turck 
mmcache to speed things up a might.


Thank you.
Teddy
 


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


[PHP] Cache

2004-08-16 Thread Octavian Rasnita
Hi all,

I want to create an html cache of a page, like when that page is saved to
the disk and let the visitors download that static page and not a dynamic
one.
Of course, a dynamic PHP program will load that static page and display it,
but without need to connect to databases, to make calculations, etc.

The problem is that I don't know how to automaticly decide when it is the
right moment to update the cache and this is very important.
I get some data from a database and the PHP program doesn't know when the
database gets updated by another program, so it cannot create the cache for
that page immediately.
If I let the program check the database each time it is ran, this takes some
times, and it is like I would not use the cache at all.

Is it possible to use that kind of cache I want? (meaning... a kind of
static page saved).

Thank you.

Teddy

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



Re: [PHP] PHP, Cache Control and Mac IE

2004-02-18 Thread Gareth Williams
Hello Roger,

If you find a solution, I would also be interested to to see it.  I 
have tried almost everything to get Mac IE to not use the cache.  It 
just doesn't seem to accept anything.

On 18 Feb 2004, at 18:58, Roger Spears wrote:

Hello List,

I am using the following in a PHP script:

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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
Most browsers will prompt the visitor to reload the data, but if a 
visitor is using IE 5.? on a Mac OS X machine, their browser's back 
button still shows them the original page from cache.  At the top of 
the page, in HTML, I've also added (along with the above headers):





and still, the browser pulls from the cache.

I'm guessing this is a bug, but I'm wondering if any one has a work 
around?

TIA,
Roger
--
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


[PHP] PHP, Cache Control and Mac IE

2004-02-18 Thread Roger Spears
Hello List,

I am using the following in a PHP script:

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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
Most browsers will prompt the visitor to reload the data, but if a 
visitor is using IE 5.? on a Mac OS X machine, their browser's back 
button still shows them the original page from cache.  At the top of the 
page, in HTML, I've also added (along with the above headers):





and still, the browser pulls from the cache.

I'm guessing this is a bug, but I'm wondering if any one has a work around?

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


RE: [PHP] cache control with javascript

2003-10-21 Thread Joshua Minnie
That really helped, I didn't think about generating the file that way.  I
have done other things like that, but sometimes it just helps when you get
another set of eyes on the project at hand.  Thanks for the refresher.

Josh

-Original Message-
From: - Edwin - [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2003 11:56 AM
To: Joshua Minnie
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] cache control with javascript



On 2003.10.21, at 22:28 Asia/Tokyo, Joshua Minnie wrote:

> The "it" that you were asking about was the server.  The javascript
> file is
> actually a PHP file that produces the JavaScript that I need.  I only
> have
> one access to a database and a while loop to generate the code.  Here
> is the
> code pieces:

...[snipped_code]...

> The customer database can get potentially large so that this file
> could take
> a while to generate.  Currently there are only 300 records but I
> anticipate
> many more.  Does anyone have any recommendations that might speed this
> up?

Hmm... I think you missed the point earlier.

Here's the basic idea. Create/generate a separate file ("whatever.js")
[1] and make sure that this file is ONLY *updated* when necessary (e.g.
updated database)[2]. Call this file inside your HTML  tags. [3]
This way, the "whatever.js" will be "cached" whenever possible.

- E -

[1] Check the file functions in the manual (if you're not familiar with
it already).
 (http://www.php.net/manual/en/ref.filesystem.php)
[2] Tip: Have a separate php script that generates the "whatever.js".
 Use/run this script ONLY after you made an update to your database.
[3] Something like this:
   
 
   

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



Re: [PHP] cache control with javascript

2003-10-21 Thread - Edwin -
On 2003.10.21, at 22:28 Asia/Tokyo, Joshua Minnie wrote:

The "it" that you were asking about was the server.  The javascript 
file is
actually a PHP file that produces the JavaScript that I need.  I only 
have
one access to a database and a while loop to generate the code.  Here 
is the
code pieces:
...[snipped_code]...

The customer database can get potentially large so that this file 
could take
a while to generate.  Currently there are only 300 records but I 
anticipate
many more.  Does anyone have any recommendations that might speed this 
up?
Hmm... I think you missed the point earlier.

Here's the basic idea. Create/generate a separate file ("whatever.js") 
[1] and make sure that this file is ONLY *updated* when necessary (e.g. 
updated database)[2]. Call this file inside your HTML  tags. [3] 
This way, the "whatever.js" will be "cached" whenever possible.

- E -

[1] Check the file functions in the manual (if you're not familiar with 
it already).
(http://www.php.net/manual/en/ref.filesystem.php)
[2] Tip: Have a separate php script that generates the "whatever.js".
Use/run this script ONLY after you made an update to your database.
[3] Something like this:
  

  

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] cache control with javascript

2003-10-21 Thread Joshua Minnie
The "it" that you were asking about was the server.  The javascript file is
actually a PHP file that produces the JavaScript that I need.  I only have
one access to a database and a while loop to generate the code.  Here is the
code pieces:

[code]
// already connected to the db
$sql = "SELECT * FROM Customers ORDER BY LastName ASC, FirstName ASC";
$result = mysql_query($sql) or die(mysql_error());

while($row = mysql_fetch_assoc($result)) {
// generate the javascript
}
[/code]

The customer database can get potentially large so that this file could take
a while to generate.  Currently there are only 300 records but I anticipate
many more.  Does anyone have any recommendations that might speed this up?

Josh

"- Edwin -" <[EMAIL PROTECTED]> wrote:
> > Does anybody know how I can make force a javascript file (written in
> > PHP) to be cached if the user agent allows it?
> >
> > Here is the situation:
> > I am creating a dropdown menu system that contains a customer list,
> > loaded from a database.  This list is written to the javascript file
> > for the menu. The menu can be quite large as the data grows.  What I
> > would like to do, is force it to be cached (unless of course the
> > user agent doesn't allow it) so that it doesn't have to make the
> > call to generate the file each time.
>
> What is the second "it" in the last sentence above? A browser wouldn't
> make the call to "generate" the javascript file each time.
>
> > I have searched through the php.net website and even through the
> > HTTP/1.1 protocols.  I am continuing to look, but have not found a
> > definite answer as to whether or not what I am trying to do is
> > possible.
>
> Just make sure that the javascript is on a separate file (i.e.
> whatever.js) and that it's NOT being generated by your (php) script
> each time. Then, "call" that file from inside your html/php page.

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



Re: [PHP] cache control with javascript

2003-10-20 Thread - Edwin -
On Mon, 20 Oct 2003 14:44:50 -0400
"Joshua Minnie" <[EMAIL PROTECTED]> wrote:

> Does anybody know how I can make force a javascript file (written in
> PHP) to be cached if the user agent allows it?
> 
> Here is the situation:
> I am creating a dropdown menu system that contains a customer list,
> loaded from a database.  This list is written to the javascript file
> for the menu. The menu can be quite large as the data grows.  What I
> would like to do, is force it to be cached (unless of course the
> user agent doesn't allow it) so that it doesn't have to make the
> call to generate the file each time.

What is the second "it" in the last sentence above? A browser wouldn't
make the call to "generate" the javascript file each time.

> I have searched through the php.net website and even through the
> HTTP/1.1 protocols.  I am continuing to look, but have not found a
> definite answer as to whether or not what I am trying to do is
> possible.

Just make sure that the javascript is on a separate file (i.e.
whatever.js) and that it's NOT being generated by your (php) script
each time. Then, "call" that file from inside your html/php page.

- E -
__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/

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



[PHP] cache control with javascript

2003-10-20 Thread Joshua Minnie
Does anybody know how I can make force a javascript file (written in PHP) to
be cached if the user agent allows it?

Here is the situation:
I am creating a dropdown menu system that contains a customer list, loaded
from a database.  This list is written to the javascript file for the menu.
The menu can be quite large as the data grows.  What I would like to do, is
force it to be cached (unless of course the user agent doesn't allow it) so
that it doesn't have to make the call to generate the file each time.

I have searched through the php.net website and even through the HTTP/1.1
protocols.  I am continuing to look, but have not found a definite answer as
to whether or not what I am trying to do is possible.

-- 
Joshua Minnie
Lead Web Application Developer
Advantage Computer Services, LLC
www.advantagecomputerservices.com
[EMAIL PROTECTED]

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



Re: [PHP] Cache

2003-08-19 Thread Chris Shiflett
--- Klaus_Kaiser_Apolinário <[EMAIL PROTECTED]> wrote:
> But this Cache control are not working

What do you mean by not working? Something is cached that shouldn't be? Also,
you are sending multiple Cache-Control headers, sending expired dates, etc. Try
a more straightforward approach first:

header('Pragma: no-cache');
header('Cache-Control: no-cache');

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] Cache

2003-08-19 Thread Klaus Kaiser Apolinário
This is the header of my aplication



[PHP] Cache Question

2003-08-14 Thread Tony Tzankoff
I have a webpage written in the latest version of PHP and need a little bit
of help with a rather pesky cache issue. Part of the source code is as
follows:

page.php
";
echo "";
.
.
.
echo "";
?>

The page does not cache (which is good), but the MP3 file does (which is
bad). Is there a way to NOT cache the MP3 file? I would like to keep the
file embedded within the page, if possible. Thanks!



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



Re: [PHP] Cache Question

2003-08-14 Thread Chris Shiflett
--- Tony Tzankoff <[EMAIL PROTECTED]> wrote:
> I have a webpage written in the latest version of PHP and need
> a little bit of help with a rather pesky cache issue. Part of
> the source code is as follows:
> 
> page.php
>  echo "";
> echo "";
> echo "";
> ?>
> 
> The page does not cache (which is good), but the MP3 file does
> (which is bad). Is there a way to NOT cache the MP3 file? I
> would like to keep the file embedded within the page, if
> possible. Thanks!

In order to understand this behavior, you need to understand how the Web works,
including a little bit about HTTP.

First, as an aside note, if you are using PHP, there is absolutely no reason to
set HTTP headers using the HTML meta tag. This is equivalent to the HTML in
your example code:

header('Pragma: no-cache');
header('Expires: -1');

Since Pragma is an HTTP/1.0 header, might I also suggest:

header('Cache-Control: no-cache');

Now, you are wondering how you can have all of these headers, yet the MP3 is
still cached. That's because these headers are not sent when the MP3 is
requested. The filename ends in .mp3, so PHP plays no role whatsoever (unless
you have done something weird to force PHP to parse files ending in .mp3).

When a Web clients sends the HTTP request for your page, it will receive
something like this in the content of the response:





Basically, the content is the output of your script, right? *This* is the stuff
that won't get cached.

Now, "filename.mp3" is just some text in the response at this point. There is
no MP3 actually embedded into the HTML somehow. The browser parses the HTML and
notices that it needs another resource, filename.mp3. Because there is no path
specified, the browser will send a request for this resource using the same
path as its parent (the page that is not going to be cached). The server will
return this file in an HTTP response, and the headers in this response have
nothing to do with your PHP script that was requested a few seconds ago. That
is history.

So, this is why the MP3 is cached while your HTML is not.

Hope that helps.

Chris

=
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

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



[PHP] cache

2003-06-11 Thread Diana Castillo
what code can I put at the begining of a php page so that the result from
the cache is never shown ?



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



Re: [PHP] Cache caches anyway, regardless

2002-12-02 Thread Justin French
on 02/12/02 10:49 PM, Elmota Abdul Ayyash ([EMAIL PROTECTED]) wrote:

> i had this problem when my pages were cached when I wanted them to be
> refreshed, so I went deep in it and included all the recomended headers
> by the manual, and it worked fine.. I also tried on a clean version, by
> emptying up the browser cache and temp files on my client machine...
> 
> until one page came from nowhere, an old old version! now my question
> is, where did that page come from? are these pages cached anywhere on
> the SERVER? I have an account on an APACHE server, and I dont know
> where to look for temporary files, if any get cached...

It could be any proxy server between the client and the server, plus any
proxies ON the server... this would include the user's local machine, their
local network, their ISP, and any ISP/server in between the client and the
server (do a traceroute), althoguh in this case it sounds like you're
talking about a LAN.

I don't *think* Apache caches anything by itself.

Of course changing the filename will ensure you aren't using a cached copy
:)




Justin French

http://Indent.com.au
Web Development & 
Graphic Design



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




[PHP] Cache caches anyway, regardless

2002-12-02 Thread Elmota Abdul Ayyash
i had this problem when my pages were cached when I wanted them to be
refreshed, so I went deep in it and included all the recomended headers
by the manual, and it worked fine.. I also tried on a clean version, by
emptying up the browser cache and temp files on my client machine...

until one page came from nowhere, an old old version! now my question
is, where did that page come from? are these pages cached anywhere on
the SERVER? I have an account on an APACHE server, and I dont know
where to look for temporary files, if any get cached...

Thank you for any help you can provide.
[EMAIL PROTECTED]

=
Yours Elmota
__
http://www.geocities.com/FashionAvenue/5774/index.html

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




[PHP] Cache issue

2002-07-31 Thread Chris Kay


Question.

I have a problem with forms not been cached when they click submit... And then the 
back button,
I know of some fields that can not be cached (password), 

I am thinking I am not doing something that asks it to cache..

Anyone have any tips or a place to start looking.

Thanks in advance

---
Chris Kay
Technical Support - Techex Communications 
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 
Platinum Channel Partner of the Year - Request DSL - Broadband for Business
---

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




[PHP] cache control and cookies...

2002-05-31 Thread Gerard Samuel

I dont know too much about cache control, but some of the users who use 
my script,
has problems with cookies.  They are able to log in and the cookie is 
set and they click a link and get booted out.
This past week, we noticed that when we commented out

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");


they had no problems.  Im looking for others who had similar 
experiences, and a fix if possible.
Im not sure if its because the expires time is too far back.  The 
cookie's lifetime is 1 month.
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




RE: [PHP] Cache Control

2002-05-31 Thread Jon Haworth

Hi Jeroen,

> I want info on the internet where i can find a manuel.

http://www.google.com/search?q=http+cache+control+headers

> the page is a php script and sometimes it comes out of a proxy but
> that is not allowed.

It's not something you have absolute control over - some proxies are
configured to ignore your caching instructions anyway.

Cheers
Jon

PS. Please try and avoid using HTML mail on lists.

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




Fwd: RE: [PHP] Cache Control

2002-05-31 Thread Jeroen Timmers


>Date: Fri, 31 May 2002 12:13:40 +0200
>To: Jon Haworth <[EMAIL PROTECTED]>
>From: Jeroen Timmers <[EMAIL PROTECTED]>
>Subject: RE: [PHP] Cache Control
>
>I want info on the internet where i can find a manuel.
>
>I want a statement that de page always refresh
>
>the page is a php script and sometimes it comes out of a proxy but
>that is not allowed.
>
>Thx Jeroen
>
>At 11:11 31-5-2002 +0100, you wrote:
>
>>Hi Jeroen,
>> > > > Where i can find more help about cache control
>> > >
>> > > http://www.google.com/search?q=help+about+cache+control
>> > > Or did you mean something a bit more specific?
>> >
>> > indeed
>> > more specific
>>
>>Well, seeing as you're not sharing the actual question with the mailing
>>list, this answer may not be exactly what you're after, but it's probably:
>>
>>
>>
>>
>>
>>;-)
>>
>>Cheers
>>Jon
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Cache Control

2002-05-31 Thread Jon Haworth


Hi Jeroen,
> > > Where i can find more help about cache control
> >
> > http://www.google.com/search?q=help+about+cache+control
> > Or did you mean something a bit more specific?
>
> indeed
> more specific

Well, seeing as you're not sharing the actual question with the mailing
list, this answer may not be exactly what you're after, but it's probably:





;-)

Cheers
Jon

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




RE: [PHP] Cache Control

2002-05-31 Thread Jeroen Timmers

indeed

more specific

Jeroen

At 11:00 31-5-2002 +0100, you wrote:
>Hi Jeroen,
>
> > Where i can find more help about cache control
>
>Here: http://www.google.com/search?q=help+about+cache+control (495,000
>results)
>
>Or did you mean something a bit more specific?
>
>Cheers
>Jon
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Cache Control

2002-05-31 Thread Jon Haworth

Hi Jeroen,

> Where i can find more help about cache control

Here: http://www.google.com/search?q=help+about+cache+control (495,000
results)

Or did you mean something a bit more specific?

Cheers
Jon

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




[PHP] Cache Control

2002-05-31 Thread Jeroen Timmers

Where i can find more help about cache control

Thx

Jeroen


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




Re: [PHP] cache

2002-03-06 Thread bvr


Hallo Jeroen ;)

There are several ways to control the caching of pages and images, 
including sending headers
and META tags. These are ofcourse HTML/HTTP features and not specific to 
PHP.

Because it seems to be needed to send a combination of these to make it 
work for a situations,
I prefer another method which works quite well on images, example:



This appends a UNIX timestamp to the image location so the browser sees 
a different image location
on each page load, forcing it to download the image every time.

bvr.



Jeroen Timmers wrote:

>is there some command with php dat 
>the page some images not load out the cache
>but reloading the image?
>
>Thx Jeroen
>




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




[PHP] cache

2002-03-06 Thread Jeroen Timmers

is there some command with php dat 
the page some images not load out the cache
but reloading the image?

Thx Jeroen



Re: [PHP] Cache Being Bad

2002-02-11 Thread nate

Nevermind everyone. I was just being an idiot and fetching from the database
BEFORE updating it. Well maybe this will at least help some people not make
the same stupid mistake.

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 11, 2002 8:19 PM
Subject: [PHP] Cache Being Bad


I have a text box on my page and a submit button. The text box value is
whatever it grabs from the database. If the user deletes what is in the text
box and puts in his own text, then hits submit, the script updates that
field with whatever the user inputs.

Problem is, after the user hits submit, it APPEARS as though the new text
was not submitted because the old text is still in the box. Yet when he
refreshes the page it shows the new text.

Does that make sense? How do I make it so the new text shows up without him
having to refresh. Also I don't want to do a redirect because I want to
print a message "Info submitted" when the user hits submit.

I have tried:

function cache_control($maxage=0)

$Modified = "Last-modified: ".gmdate("D, d M Y H:i:s", time())." GMT";
$Expires = "Expires: ".gmdate("D, d M Y H:i:s", time() + $maxage)." GMT";
$CacheControl = "Cache-Control: must-revalidate, max-age=".$maxage.", ";
$CacheControl.= "s-max-age=".$maxage;
Header($CacheControl);
Header($Modified);
Header($Expires);
}

cache_control(0);


Thanks so much for reading,
Nate



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




[PHP] Cache Being Bad

2002-02-11 Thread nate

I have a text box on my page and a submit button. The text box value is whatever it 
grabs from the database. If the user deletes what is in the text box and puts in his 
own text, then hits submit, the script updates that field with whatever the user 
inputs. 

Problem is, after the user hits submit, it APPEARS as though the new text was not 
submitted because the old text is still in the box. Yet when he refreshes the page it 
shows the new text. 

Does that make sense? How do I make it so the new text shows up without him having to 
refresh. Also I don't want to do a redirect because I want to print a message "Info 
submitted" when the user hits submit. 

I have tried: 

function cache_control($maxage=0) { 
$Modified = "Last-modified: ".gmdate("D, d M Y H:i:s", time())." GMT"; 
$Expires = "Expires: ".gmdate("D, d M Y H:i:s", time() + $maxage)." GMT"; 
$CacheControl = "Cache-Control: must-revalidate, max-age=".$maxage.", "; 
$CacheControl.= "s-max-age=".$maxage; 
Header($CacheControl); 
Header($Modified); 
Header($Expires); 
} 

cache_control(0); 


Thanks so much for reading, 
Nate



[PHP] Cache-Control: no-cache and browser back button problem

2002-02-10 Thread Steven Haryanto

why does the cache control header generated by php (under 
session_cache_limiter = nocache) needs to have no-store? It 
makes pressing Back in the browser requests a new version of the 
page (which is unwanted in some situations, e.g. while filling 
form and needs to edit a few fields before re-submitting).

Also, when I am editing the script and had a fatal error (like a 
PHP syntax error), the stored version of the page by the browser 
is always the one with a fatal error, and I need to always 
refresh to get the current version (I am using a 'Never check 
for newer versions of pages' in my browser, which is fine for 
most circumstances).

Can I remove the 'no-store' parameter from the generated 
Cache-Control header, without resorting to session_cache_limiter 
= private (since this also have some Refresh problems in IE)?

--
sh


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




[PHP] Cache Control

2001-11-18 Thread Jeff Sittler

How do I set a page to cache for only 5 minutes?

In ASP, I ahve used:
<%
 Response.CacheControl = "no-cache"
 Response.AddHeader "Pragma", "no-cache"
 Response.Expires = -1
 if Session("svUsername") = "" then response.redirect
"../login/accessDenied.asp"
%>
and I could just change the Response.Expires to how ever many seconds I
wanted the page to stay cached.

My PHP scripts, I'm using:
  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");
I don't see an option where I can tell it to cache for say 5 minutes.

Any help would be appreciated.

Jeff




-- 
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] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread Maxim Maletsky \(PHPBeginner.com\)

Both will do good jobs, but is the site is very loaded PHP might take
less resources than jsp and asp from the server. Yet has to be well
configured. It all depends on how you use it.

PHP is a great solution for most heavy sites. I never had any problems
with it on a 4+ million pv/month site. Most of other developers will
probably agree with me.


Maxim Maletsky
www.PHPBeginner.com



-Original Message-
From: mydata [mailto:[EMAIL PROTECTED]] 
Sent: giovedì 27 settembre 2001 9.04
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Does PHP + PHP CACHE can vs JSP ?


I just want to know which is best solution , if my web site is heavy
loaded.


mydata



"Jason G." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> A good question is:  Do you REALLY need the speed difference, or 
> should
you
> be asking which is the best language to do Dynamic Web Development 
> in???  Which is better supported, which is most cost effective, which 
> is Open Source, which is Better...
>
> -Jason Garber
> deltacron.com
>
> At 02:48 PM 9/27/2001 +0800, mydata wrote:
> >Hi,
> >I heard about JSP a lot recently though I doing PHP programing now. 
> >somebody said jsp is most fastest in (asp , php , jsp). I want to 
> >know if it is true . And if I use PHP + php cache , can I speed
up
> >PHP as same as JSP as they said.
> >
> >I just want to know which is the best solution ,(php + php cache) or 
> >jsp
.
> >
> >
> >
> >--
> >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 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 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] Does PHP + PHP CACHE can vs JSP ?

2001-09-27 Thread Rasmus Lerdorf

Pretty much impossible to answer.  If you know what you are doing, you can
use just about anything to build a solution that will work on a heavily
loaded site.  JSP is typically not faster than PHP or even ASP though.

But chances are your scripting language won't be your limiting factor
anyway.  If your site relies on a database, chances are your database
speed will be the slowest part, or even more common, your pipe will be
your limiting factor.

Proper load balancing of your database and something like Squid as a
reverse proxy in front of your dynamic pages with proper cache-control
headers being generated, you can handle just about any load.

-Rasmus

On Thu, 27 Sep 2001, mydata wrote:

> I just want to know which is best solution , if my web site is heavy loaded.
>
>
> mydata
>
>
>
> "Jason G." <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > A good question is:  Do you REALLY need the speed difference, or should
> you
> > be asking which is the best language to do Dynamic Web Development
> > in???  Which is better supported, which is most cost effective, which is
> > Open Source, which is Better...
> >
> > -Jason Garber
> > deltacron.com
> >
> > At 02:48 PM 9/27/2001 +0800, mydata wrote:
> > >Hi,
> > >I heard about JSP a lot recently though I doing PHP programing now.
> > >somebody said jsp is most fastest in (asp , php , jsp).
> > >I want to know if it is true . And if I use PHP + php cache , can I speed
> up
> > >PHP as same as JSP as they said.
> > >
> > >I just want to know which is the best solution ,(php + php cache) or jsp
> .
> > >
> > >
> > >
> > >--
> > >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 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] Does PHP + PHP CACHE can vs JSP ?

2001-09-26 Thread mydata

I just want to know which is best solution , if my web site is heavy loaded.


mydata



"Jason G." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> A good question is:  Do you REALLY need the speed difference, or should
you
> be asking which is the best language to do Dynamic Web Development
> in???  Which is better supported, which is most cost effective, which is
> Open Source, which is Better...
>
> -Jason Garber
> deltacron.com
>
> At 02:48 PM 9/27/2001 +0800, mydata wrote:
> >Hi,
> >I heard about JSP a lot recently though I doing PHP programing now.
> >somebody said jsp is most fastest in (asp , php , jsp).
> >I want to know if it is true . And if I use PHP + php cache , can I speed
up
> >PHP as same as JSP as they said.
> >
> >I just want to know which is the best solution ,(php + php cache) or jsp
.
> >
> >
> >
> >--
> >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 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] Does PHP + PHP CACHE can vs JSP ?

2001-09-26 Thread Jason G.

A good question is:  Do you REALLY need the speed difference, or should you 
be asking which is the best language to do Dynamic Web Development 
in???  Which is better supported, which is most cost effective, which is 
Open Source, which is Better...

-Jason Garber
deltacron.com

At 02:48 PM 9/27/2001 +0800, mydata wrote:
>Hi,
>I heard about JSP a lot recently though I doing PHP programing now.
>somebody said jsp is most fastest in (asp , php , jsp).
>I want to know if it is true . And if I use PHP + php cache , can I speed up
>PHP as same as JSP as they said.
>
>I just want to know which is the best solution ,(php + php cache) or jsp .
>
>
>
>--
>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 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] Does PHP + PHP CACHE can vs JSP ?

2001-09-26 Thread mydata

Hi,
I heard about JSP a lot recently though I doing PHP programing now.
somebody said jsp is most fastest in (asp , php , jsp).
I want to know if it is true . And if I use PHP + php cache , can I speed up
PHP as same as JSP as they said.

I just want to know which is the best solution ,(php + php cache) or jsp .



-- 
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] Cache Control with forms

2001-04-20 Thread Diego Fulgueira

Rasmus, thanks a lot!! Your information has been very helpful because now I
know more ways to play with the headers!.
Still, I am almost sure that it's possible to do what I want to do because I
think I've seen such behaviour in other websites, for example Yahoo! Mail
(note that the site does not have to be programmed in PHP because we are
talking about then client behaviour, not the server's).

Thanks a lot again, I am sure with your information I'll be able to work it
out... and then I'll post the solution here!

Cheers, Diego.

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 19 April, 2001 8:34 PM
To: Diego Fulgueira
Cc: Php-General
Subject: Re: [PHP] Cache Control with forms


> Hi everyone! I have the following problem:
> I don't want any of my site's pages to be saved on any  browser's cache.
> Yet, I want all HTML forms to keep their data when the user changes to
> another page without submiting and then comes back using the back button.
>
> I have seen changing the session.cache_limiter configuration option to
> 'private' instead of 'nocache' works to make all forms keep their data,
but
> then all pages are diplayed from the browser's cache even after refreshing
> several times!. I want a point in between, but I don't know how to get
> there.
>
> By the way, do you know what do the values that session.cache_limiter  can
> take mean? (nocache, private and public)

When you set it to 'nocache' you get a set of HTTP headers that look like
this:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache

That forces things to not be cached anywhere.

The 'private' setting sends these headers:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, max-age=10800, pre-check=10800

The expires header is set to a time in the past to force non-HTTP 1.1
compliant caches not to cache the page.  For HTTP-1.1 caches that
understand the cache-control header the page will be cached only in
private caches (ie. the end-user http-1.1 compliant browser) for the time
specified by the session.cache_expire setting.


The 'public' setting sends headers like this:

Expires: Thu, 19 Apr 2001 20:57:16 GMT
Cache-Control: public, max-age=10800

Basically this means that the page is allowed to be cached in both public
(like AOL's proxy-cache) and private caches for the time specified by
session.cache_expire

And no, I don't know of a way to do what you want.  I don't think you can
have the back button working and at the same time not allow private
caching.

-Rasmus


--
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 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] Cache Control with forms

2001-04-19 Thread Rasmus Lerdorf

> Hi everyone! I have the following problem:
> I don't want any of my site's pages to be saved on any  browser's cache.
> Yet, I want all HTML forms to keep their data when the user changes to
> another page without submiting and then comes back using the back button.
>
> I have seen changing the session.cache_limiter configuration option to
> 'private' instead of 'nocache' works to make all forms keep their data, but
> then all pages are diplayed from the browser's cache even after refreshing
> several times!. I want a point in between, but I don't know how to get
> there.
>
> By the way, do you know what do the values that session.cache_limiter  can
> take mean? (nocache, private and public)

When you set it to 'nocache' you get a set of HTTP headers that look like
this:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

That forces things to not be cached anywhere.

The 'private' setting sends these headers:

Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, max-age=10800, pre-check=10800

The expires header is set to a time in the past to force non-HTTP 1.1
compliant caches not to cache the page.  For HTTP-1.1 caches that
understand the cache-control header the page will be cached only in
private caches (ie. the end-user http-1.1 compliant browser) for the time
specified by the session.cache_expire setting.


The 'public' setting sends headers like this:

Expires: Thu, 19 Apr 2001 20:57:16 GMT
Cache-Control: public, max-age=10800

Basically this means that the page is allowed to be cached in both public
(like AOL's proxy-cache) and private caches for the time specified by
session.cache_expire

And no, I don't know of a way to do what you want.  I don't think you can
have the back button working and at the same time not allow private
caching.

-Rasmus


-- 
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] Cache Control with forms

2001-04-19 Thread Diego Fulgueira

Hi everyone! I have the following problem:
I don't want any of my site's pages to be saved on any  browser's cache.
Yet, I want all HTML forms to keep their data when the user changes to
another page without submiting and then comes back using the back button.

I have seen changing the session.cache_limiter configuration option to
'private' instead of 'nocache' works to make all forms keep their data, but
then all pages are diplayed from the browser's cache even after refreshing
several times!. I want a point in between, but I don't know how to get
there.

By the way, do you know what do the values that session.cache_limiter  can
take mean? (nocache, private and public)

Thanks a lot you are all very kind.
Cheers, Diego.


-- 
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] Cache bypass

2001-03-23 Thread Richard Lynch

If you can add a unique number (microtime() * 100) or uniqid() to the
URL, then the browser and server and everybody in between will be pretty
sure it's a different URL and re-load it.

echo "foo";

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: "Barry Russell" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Tuesday, March 20, 2001 8:25 PM
Subject: [PHP] Cache bypass


> Can anyone point me at a way to pick up a url entered in a form
> and construct an HTTP request that will download the requested
> page into the browser window with an enforced refresh that
> bypasses a local cache ?
>
> (I have a tough local policy to get thru which doesn't take account
> of developers working at a distance...)
>
> Thanks,
> Barry
>
> --
> 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 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] Cache

2001-03-20 Thread Matt Stone

No prob, that works fine. Thanks so much :)

-Original Message-
From: Tyrone Mills [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 March 2001 2:04 PM
To: Matt Stone; PHPlist
Subject: RE: [PHP] Cache


Yup, at the beginning of your PHP script. Sorry, I should have mentioned
that... :)

-Original Message-
From: Matt Stone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 8:04 PM
To: Tyrone Mills; PHPlist
Subject: RE: [PHP] Cache


That goes in the PHP code no?

-Original Message-
From: Tyrone Mills [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 March 2001 1:56 PM
To: Matt Stone; PHPlist
Subject: RE: [PHP] Cache


Hi Matt,

For a very extensive solution, check this out:

http://www.zend.com/codex.php?id=435&single=1

Or, if you just want all your pages to be forced to load all the time
regardless...

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");


-Original Message-
From: Matt Stone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 7:39 PM
To: PHPlist
Subject: [PHP] Cache


Hi,
This might be a little of topic...
I am having real trouble with cached PHP pages, they just never seem to
refresh... I have dissabled my local cache (IE5.5 Win2k) to the best of my
knowledge (suggestions on how to do this properly welcome) but are still
having trouble.
I am not sure whether it is my local cache my ISP's cache. Anyhow, can
anyone suggest a tag or something for me to put in my page so it refreshes
and bypasses the cache? It is getting _REALLY_ annoying :\
Thanks,

Matt Stone


--
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 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 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 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] Cache

2001-03-20 Thread Tyrone Mills

Yup, at the beginning of your PHP script. Sorry, I should have mentioned
that... :)

-Original Message-
From: Matt Stone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 8:04 PM
To: Tyrone Mills; PHPlist
Subject: RE: [PHP] Cache


That goes in the PHP code no?

-Original Message-
From: Tyrone Mills [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 March 2001 1:56 PM
To: Matt Stone; PHPlist
Subject: RE: [PHP] Cache


Hi Matt,

For a very extensive solution, check this out:

http://www.zend.com/codex.php?id=435&single=1

Or, if you just want all your pages to be forced to load all the time
regardless...

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");


-Original Message-
From: Matt Stone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 7:39 PM
To: PHPlist
Subject: [PHP] Cache


Hi,
This might be a little of topic...
I am having real trouble with cached PHP pages, they just never seem to
refresh... I have dissabled my local cache (IE5.5 Win2k) to the best of my
knowledge (suggestions on how to do this properly welcome) but are still
having trouble.
I am not sure whether it is my local cache my ISP's cache. Anyhow, can
anyone suggest a tag or something for me to put in my page so it refreshes
and bypasses the cache? It is getting _REALLY_ annoying :\
Thanks,

Matt Stone


--
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 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 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 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] Cache

2001-03-20 Thread Matt Stone

That goes in the PHP code no?

-Original Message-
From: Tyrone Mills [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 21 March 2001 1:56 PM
To: Matt Stone; PHPlist
Subject: RE: [PHP] Cache


Hi Matt,

For a very extensive solution, check this out:

http://www.zend.com/codex.php?id=435&single=1

Or, if you just want all your pages to be forced to load all the time
regardless...

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");


-Original Message-
From: Matt Stone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 7:39 PM
To: PHPlist
Subject: [PHP] Cache


Hi,
This might be a little of topic...
I am having real trouble with cached PHP pages, they just never seem to
refresh... I have dissabled my local cache (IE5.5 Win2k) to the best of my
knowledge (suggestions on how to do this properly welcome) but are still
having trouble.
I am not sure whether it is my local cache my ISP's cache. Anyhow, can
anyone suggest a tag or something for me to put in my page so it refreshes
and bypasses the cache? It is getting _REALLY_ annoying :\
Thanks,

Matt Stone


--
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 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 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] Cache

2001-03-20 Thread Tyrone Mills

Hi Matt,

For a very extensive solution, check this out:

http://www.zend.com/codex.php?id=435&single=1

Or, if you just want all your pages to be forced to load all the time
regardless...

header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
header("Expires: Mon,26 Jul 1997 05:00:00 GMT");


-Original Message-
From: Matt Stone [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 20, 2001 7:39 PM
To: PHPlist
Subject: [PHP] Cache


Hi,
This might be a little of topic...
I am having real trouble with cached PHP pages, they just never seem to
refresh... I have dissabled my local cache (IE5.5 Win2k) to the best of my
knowledge (suggestions on how to do this properly welcome) but are still
having trouble.
I am not sure whether it is my local cache my ISP's cache. Anyhow, can
anyone suggest a tag or something for me to put in my page so it refreshes
and bypasses the cache? It is getting _REALLY_ annoying :\
Thanks,

Matt Stone


--
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 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] Cache

2001-03-20 Thread Matt Stone

Hi,
This might be a little of topic...
I am having real trouble with cached PHP pages, they just never seem to
refresh... I have dissabled my local cache (IE5.5 Win2k) to the best of my
knowledge (suggestions on how to do this properly welcome) but are still
having trouble.
I am not sure whether it is my local cache my ISP's cache. Anyhow, can
anyone suggest a tag or something for me to put in my page so it refreshes
and bypasses the cache? It is getting _REALLY_ annoying :\
Thanks,

Matt Stone


-- 
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] Cache bypass

2001-03-20 Thread Barry Russell

Can anyone point me at a way to pick up a url entered in a form 
and construct an HTTP request that will download the requested 
page into the browser window with an enforced refresh that 
bypasses a local cache ?

(I have a tough local policy to get thru which doesn't take account 
of developers working at a distance...)

Thanks,
Barry

-- 
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]




AW: AW: [PHP] Cache Database-driven site

2001-03-13 Thread Joe Maier

Aaron,

this is obviously exactly what i need!!
Thanks a lot - this saved me days of work!

Joe

-Ursprungliche Nachricht-
Von: Aaron Tuller [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 13. Marz 2001 05:41
An: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Betreff: Re: AW: [PHP] Cache Database-driven site


all you need to do is wrap your pages in:

ob_start();

// your code

$page = ob_get_contents();

// write $page to a file or whatever you want to do

and then depending on if this script is being called by cron or just
when people load the page you can either do an ob_end_flush() or
ob_end_clean()

it's easy.

At first I didn't beleive output buffering was that cool, now I thnk
it's one of the best things PHP has to offer.  You can use it for a
lot of things, check it out.

-aaron

At 12:40 AM +0100 3/13/01, Joe Maier wrote:
>Aaron,
>i would love to believe what you say.
>But i couldn't find any buffering functions in the online docs.
>
>Could you please gimme a pointer on where i can find these functions
>and what's their name. Are they available in php3?
>
>Thanks a lot,
>Joe
>
>-Ursprungliche Nachricht-
>Von: Aaron Tuller [mailto:[EMAIL PROTECTED]]
>Gesendet: Montag, 12. Marz 2001 23:26
>An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Betreff: Re: [PHP] Cache Database-driven site
>
>
>At 11:19 PM +0100 3/12/01, Joachim Maier wrote:
>>To create the HTML-cache page i need to build the whole HTML-page content
>in
>>memory, instead of echoing it back to the user's browser, and finally
write
>>it to disk. That means, i have to write all HTML in php-code. I can't just
>>embed php-parts in html tags.
>
>that's not true.  see the output buffering functions.
>
>-aaron
>
>--
>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 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 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: AW: [PHP] Cache Database-driven site

2001-03-12 Thread Aaron Tuller

all you need to do is wrap your pages in:

ob_start();

// your code

$page = ob_get_contents();

// write $page to a file or whatever you want to do

and then depending on if this script is being called by cron or just 
when people load the page you can either do an ob_end_flush() or 
ob_end_clean()

it's easy.

At first I didn't beleive output buffering was that cool, now I thnk 
it's one of the best things PHP has to offer.  You can use it for a 
lot of things, check it out.

-aaron

At 12:40 AM +0100 3/13/01, Joe Maier wrote:
>Aaron,
>i would love to believe what you say.
>But i couldn't find any buffering functions in the online docs.
>
>Could you please gimme a pointer on where i can find these functions
>and what's their name. Are they available in php3?
>
>Thanks a lot,
>Joe
>
>-Ursprungliche Nachricht-
>Von: Aaron Tuller [mailto:[EMAIL PROTECTED]]
>Gesendet: Montag, 12. Marz 2001 23:26
>An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
>Betreff: Re: [PHP] Cache Database-driven site
>
>
>At 11:19 PM +0100 3/12/01, Joachim Maier wrote:
>>To create the HTML-cache page i need to build the whole HTML-page content
>in
>>memory, instead of echoing it back to the user's browser, and finally write
>>it to disk. That means, i have to write all HTML in php-code. I can't just
>>embed php-parts in html tags.
>
>that's not true.  see the output buffering functions.
>
>-aaron
>
>--
>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 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] Cache Database-driven site

2001-03-12 Thread Jon Snell

There are already some caching packages out there, I'm not sure how they
perform with CGI (look into Squid).  Having each page check for a cached
version of itself sounds like a complicated approach.  Another idea is to
generate portions of your site as that don't change often from perl scripts,
and run these from cron.  Using server-side-includes can make this a much
easier process.

-Original Message-
From: Joachim Maier [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 12, 2001 4:20 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Cache Database-driven site


Hi all,

i'm appreciating any comments on this idea:

I'm about to create a completely database driven site (mySQL).
Almost all of the output is generated from database data.

A big part of the data is rather static of nature, eg. updated once a month.
A smaller part is quite dynamic, e.g. content is added daily.

Now the problem:
My webhoster's database server (not the webserver!) is nearly breaking down
in high-traffic-times.
While static sites are performing fine, my site is almost down :-((

Here my idea:
I thought of creating a cache-mechanism where each php-page checks for the
existence of a static html-cache-page that holds its contents. When the page
is there it is read and echoed out to the browser. If it isn't there, it
shall be created automatically.

To create the HTML-cache page i need to build the whole HTML-page content in
memory, instead of echoing it back to the user's browser, and finally write
it to disk. That means, i have to write all HTML in php-code. I can't just
embed php-parts in html tags.

I'm not sure, whether this is the right way to go, as i can see some major
drawbacks of this approach, although my general php-architecture is template
oriented, which would make the approach practical.

I would really appreciate some comments on this.

Thanks in advance,
Joe



--
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 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: AW: [PHP] Cache Database-driven site

2001-03-12 Thread Andrew Hill

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

Regards,
Andrew


On 3/12/01 6:40 PM, "Joe Maier" <[EMAIL PROTECTED]> wrote:

> Aaron,
> i would love to believe what you say.
> But i couldn't find any buffering functions in the online docs.
> 
> Could you please gimme a pointer on where i can find these functions
> and what's their name. Are they available in php3?
> 
> Thanks a lot,
> Joe
> 
> -Ursprungliche Nachricht-
> Von: Aaron Tuller [mailto:[EMAIL PROTECTED]]
> Gesendet: Montag, 12. Marz 2001 23:26
> An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Betreff: Re: [PHP] Cache Database-driven site
> 
> 
> At 11:19 PM +0100 3/12/01, Joachim Maier wrote:
>> To create the HTML-cache page i need to build the whole HTML-page content
> in
>> memory, instead of echoing it back to the user's browser, and finally write
>> it to disk. That means, i have to write all HTML in php-code. I can't just
>> embed php-parts in html tags.
> 
> that's not true.  see the output buffering functions.
> 
> -aaron
> 
> --
> 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 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]




AW: [PHP] Cache Database-driven site

2001-03-12 Thread Joe Maier

Aaron,
i would love to believe what you say.
But i couldn't find any buffering functions in the online docs.

Could you please gimme a pointer on where i can find these functions
and what's their name. Are they available in php3?

Thanks a lot,
Joe

-Ursprungliche Nachricht-
Von: Aaron Tuller [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 12. Marz 2001 23:26
An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Betreff: Re: [PHP] Cache Database-driven site


At 11:19 PM +0100 3/12/01, Joachim Maier wrote:
>To create the HTML-cache page i need to build the whole HTML-page content
in
>memory, instead of echoing it back to the user's browser, and finally write
>it to disk. That means, i have to write all HTML in php-code. I can't just
>embed php-parts in html tags.

that's not true.  see the output buffering functions.

-aaron

--
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 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] Cache Database-driven site

2001-03-12 Thread Aaron Tuller

At 11:19 PM +0100 3/12/01, Joachim Maier wrote:
>To create the HTML-cache page i need to build the whole HTML-page content in
>memory, instead of echoing it back to the user's browser, and finally write
>it to disk. That means, i have to write all HTML in php-code. I can't just
>embed php-parts in html tags.

that's not true.  see the output buffering functions.

-aaron

-- 
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] Cache Database-driven site

2001-03-12 Thread Joachim Maier

Hi all,

i'm appreciating any comments on this idea:

I'm about to create a completely database driven site (mySQL).
Almost all of the output is generated from database data.

A big part of the data is rather static of nature, eg. updated once a month.
A smaller part is quite dynamic, e.g. content is added daily.

Now the problem:
My webhoster's database server (not the webserver!) is nearly breaking down
in high-traffic-times.
While static sites are performing fine, my site is almost down :-((

Here my idea:
I thought of creating a cache-mechanism where each php-page checks for the
existence of a static html-cache-page that holds its contents. When the page
is there it is read and echoed out to the browser. If it isn't there, it
shall be created automatically.

To create the HTML-cache page i need to build the whole HTML-page content in
memory, instead of echoing it back to the user's browser, and finally write
it to disk. That means, i have to write all HTML in php-code. I can't just
embed php-parts in html tags.

I'm not sure, whether this is the right way to go, as i can see some major
drawbacks of this approach, although my general php-architecture is template
oriented, which would make the approach practical.

I would really appreciate some comments on this.

Thanks in advance,
Joe



-- 
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] Cache Problem

2001-02-20 Thread Peter Houchin

Hiya,

I have a question with reguard to Cache

At the moment I'm using  but when

i go view the page in NN all the data comes up but if say i wanted to print

the data it prints a page saying "Data Missing" .. this document resulted

from a POST operation and has expired from cache..."

and I don't understand why .. because i thought i had this covered using

this script 

if ($REQUEST_METHOD=='POST')

{

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

header('Cache-Control: Private');

}



could some one please offer some suggestions

Thanks

Peter




Re: [PHP] cache problem

2001-02-16 Thread Chris Lee

  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');


--


Chris Lee
Mediawaveonline.com

em. [EMAIL PROTECTED]

ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120


"Jan Grafström" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi! I have this php answer on the request sent from flash5 to serverside
> php-file:
>
>
records=8&score0=14&name0=janna&med0=hej4&date0=16:11:32&score1=13&name1=jan
na&med1=hej3&date1=16:06:52&score2=12&name2=janna&med2=hej2&date2=16:06:42&s
core3=11&name3=janna&med3=hej&date3=16:06:31&score4=10&name4=Janna&med4=hej
>
anton&date4=10:24:00&score5=9&name5=Anton&med5=8&date5=23:31:26&score6=8&nam
e6=Anton&med6=7&date6=23:31:21&reply=Thanks!
> Updated&updated=1&
>
> My problem is that IE5.5 cache this file.
> Anybody know if it`s possible to set some code in the php-file to
> prevent this.
> I have tried with metatags on both the php and the html in which the swf
> resides with no result.
> Thanks
> Jan
>
>
> --
> 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 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] cache problem

2001-02-16 Thread Jan Grafström

Hi! I have this php answer on the request sent from flash5 to serverside
php-file:

records=8&score0=14&name0=janna&med0=hej4&date0=16:11:32&score1=13&name1=janna&med1=hej3&date1=16:06:52&score2=12&name2=janna&med2=hej2&date2=16:06:42&score3=11&name3=janna&med3=hej&date3=16:06:31&score4=10&name4=Janna&med4=hej
anton&date4=10:24:00&score5=9&name5=Anton&med5=8&date5=23:31:26&score6=8&name6=Anton&med6=7&date6=23:31:21&reply=Thanks!
Updated&updated=1&

My problem is that IE5.5 cache this file.
Anybody know if it`s possible to set some code in the php-file to
prevent this.
I have tried with metatags on both the php and the html in which the swf
resides with no result.
Thanks
Jan


-- 
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] Alternative PHP Cache

2001-02-06 Thread Herman Tolentino

Dear folks,

Anybody out there with experience using Alternative PHP Cache
(http://apc.communityconnect.com)? I am at a loss for information regarding
its use with PHP, specifically, Zend Optimizer. Thanks in advance.

Herman


-- 
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] APC Alternative PHP Cache Release Announcement

2001-01-12 Thread Monte Ohrt

I've been trying to get this to compile on SPARC Solaris 2.7, and having
troubles with the semaphore syntax. If anyone gets this to compile on
Solaris, please post your patches!

Thanks

Michael Kimsal wrote:
> 
> George Schlossnagle wrote:
> 
> > I'd like to announce the release of the APC Alternative PHP Cache
> > http://apc.communityconnect.com/ .  APC works by caching the scripts in
> > shared memory post-compilation to effectively eliminate the overhead of
> > parsing and compilation.  APC was developed as a completely free and
> > open alternative to the Zend Cache, and is extremely robust and
> > flexible.  Performance increases are very significant (100-200% on many
> > of our scripts, which admittedly have lengthy includes.  You results may
> > vary. :)
> >
> > george
> >
> 
> Wanted to just post a quick thanks to George and the other developer(s)
> of this product.  Couple teething problems last night, and we have to plan the 
>upgrade for a couple live boxes, but it worked *quite* well - the tests I did so far 
>showed 10-20%
> improvement on the low end and up to 200% increase.
> 
> Admittedly it's 'just' apachebench 'blast' testing, but going to 34 pps to 104pps is 
>quite remarkable.
> 
> Thanks guys.  :)
> 
> --
> 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 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]




  1   2   >