eddo Posted June 27, 2009 Share Posted June 27, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/163918-get-older-file-when-doing-a-read/ Share on other sites More sharing options...
Alex Posted June 27, 2009 Share Posted June 27, 2009 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> Quote Link to comment https://forums.phpfreaks.com/topic/163918-get-older-file-when-doing-a-read/#findComment-864818 Share on other sites More sharing options...
Daniel0 Posted June 27, 2009 Share Posted June 27, 2009 You can use a .htaccess file to prevent caching of dynamic pages: No, you can kindly ask the user agent not to cache it, but you cannot prevent it or force people not to. Once you send me the data, I can do whatever I want with it. Quote Link to comment https://forums.phpfreaks.com/topic/163918-get-older-file-when-doing-a-read/#findComment-864821 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.