Mon 16 Jan 2012 11:18:23 AM UTC, original submission:
I have apache/mod_dav and dav2fs all on the same host. dav2fs is used to mount what Apache is serving to the local filesystem - a sort of loopback. The purpose is that the content of the files served is dynamic and comes from a postgres database via php. In this case the file is an email footer/disclaimer that changes periodically and is read by the mail program.
This mostly works well, but when I try to cp a file from the dav directory to another part of the filesystem, it cp does not seem to trigger the 'has the file changed' check in dav2fs - it just gets the cached copy. Note the php file has not changed, only the dynamic content because something has been updated in the database.
On the other hand, if I cp again 5 seconds later, the correct file contents is copied. I've ended up with a script like this:
#!/bin/bash
cp /root/pgdav/disclaimer.html /etc/postfix/disclaimer.html
sleep 5
cp /root/pgdav/disclaimer.html /etc/postfix/disclaimer.html
Caching related headers in php are set as follows:
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
I've set file_refresh 0 in davfs2.conf.
Is there some other setting I am missing to change this behaviour, or am I hitting a bug?
Many thanks,
Jack
|