Reply to Re: Does PHP "cache" scripts?

Your name:

Reply:


Posted by Jerry Stuckle on 09/15/06 03:17

StevePBurgess@gmail.com wrote:
> Hi - thanks for the reply. The script is stripped bare - there is error
> checking on the actual script and all queries work fine.
>
> When I say it doesn't work - I just mean the user clicks on the link
> and is returned almost immediately to the page as if nothing has
> happened.
>
> I have just tried it in Internet Explorer and it seems to work there -
> but sometimes I have to "refresh" the page to see the effect, sometimes
> it updates ok.
>
> In firefox, sometimes it works and sometimes it doesn't. When it does,
> the page updates itself to reflect the "move up" - if it doesn't work
> refreshing has no effect.
>
> If I try the link in firefox and it doesn't work and then close firefox
> down and visit the same link on the same page and then try, it works
> (hence a suspicion of caching or session issues).
>
> As I say - it works perfectly in all browsers on my dedicated server.
> Exactly the same script - just a different server - so I am assuming it
> is a server issue.
>
> I'm flummoxed!
>
> Best,
> Steve
>
>
> Andy Hassall wrote:
>
>>On 14 Sep 2006 13:41:23 -0700, StevePBurgess@gmail.com wrote:
>>
>>
>>>On my own server this works perfectly - but when I upload it to my
>>>client's shared server it sometimes works and sometimes doesn't. It is
>>>intermittent.
>>
>> How do you mean it doesn't work, exactly?
>>
>>
>>>Could PHP be returning a cached result of the script? If no, what on
>>>earth can be happening?
>>
>> PHP doesn't cache scripts. There's extensions like APC that cache the compiled
>>form of the script, but that doesn't (or shouldn't) have anything to with the
>>results.
>>
>> MySQL can be configured to have a cache, but I don't know much about that.
>>
>> Your browser can cache, but you can send headers that advise the browser not
>>to cache (look up the Pragma HTTP header).
>>
>> Your ISP may have "transparent" caching proxies; ntl: are infamous for that.
>>
>> It could be something much simpler; I don't see any error checking on the
>>mysql_query calls.
>>
>>--
>>Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
>>http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
>
>
Andy,

Not necessarily a server issue. It could be anything between the server
and your system that's caching the page.

But it definitely sounds like a caching issue. Nothing in PHP or MySQL
would do this.

You might try adding a random string as a parameter, such as:
http://www.example.com/showinfo.php?n=12345

where you get the value from microtime() or similar. This should take
care of caching issues.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация