Jump to content

get older file when doing a read!


eddo

Recommended Posts

OK - I give up -help. I'm getting results which seem to prove that when I run/test my php code on my server (it also happens on localhost) my reads are reading from some cache somewhere on the server. This is FRUSTATING, to say the least. This can happen when my code is reading a data file (flat text) or whem including a php file. For example, I once replaced a single include statement with the code it brought in, and got some error message about an invalid phpinclude statement - my code at that point didn't even have an include statement. I can find text in the help manual about flushing output buffers, but there seems to be no command to force PHP to go to the hard disk on a read. Am I right about this? Is there a way to force PHP to go to the disk on all reads, like you can ctrl-refresh to get your browser to read from the site instead of the cache?

Link to comment
Share on other sites

You can use a .htaccess file to prevent caching of dynamic pages:

 

<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</FilesMatch>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.