I have an HTML page with data that is updated once a day at 5pm. Ultimately I would like mod_expires to be able to expire this web page every Monday - Friday at 5pm, and will settle for expiring .html file daily at 5pm. Diving deeper, the main HTML file is index.html and the daily updated file is mosaic.html which is a Server Side Include file, <!--#include virtual="mosaic.html"-->. The end user / browser never sees mosaic.html directly. Alternatively, if mod_expires could use the most recent modification time of any file that is server side included (e.g. mosaic.html), an ExpiresDefault "modification plus 1 day" rule might be able to solve this use case.
I have built a workaround, however it is kind of a kludge. I cache html files for a day after access. For html files with SSI content that is updated Monday-Friday at 5pm, I have a FilesMatch rule which expires these files a day after modification. In order for these files to have an expiration date in the future I implemented a cron job to touch these files everyday at 5pm, even on the weekend when data is not updated. Here is the relevant configuration for this setup: <FilesMatch "\.(html)$"> Header set Cache-Control "no-transform, s-maxage=86400, max-age=86400, stale-while-revalidate=7200, stale-if-error=7200" ExpiresActive on ExpiresDefault "access plus 1 day" </FilesMatch> <FilesMatch "(going-public|index|investing-basics|stock-investing|support-privacy|tools)\.html$"> Header set Cache-Control "no-transform, s-maxage=3600, stale-while-revalidate=7200, stale-if-error=7200" ExpiresActive on ExpiresDefault "modification plus 1 day" </FilesMatch>