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
https://forums.phpfreaks.com/topic/163918-get-older-file-when-doing-a-read/
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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.