Score:0

Apache expressions: Function "file" - How about the performance?

cu flag

How about the performance of Apache's expression function "file"? Does anybody have any experience? Does it only load on start-up? Does it load on first access? Does it always re-load if section is (re-)entered? Does it cache the contents? Does it re-read on changes only? I have not seen any documentation or comments about this function regarding its performance or how it works in detail.

HBruijn avatar
in flag
Are you talking about this [`file`](https://httpd.apache.org/docs/2.4/expr.html#functions) function ? I imagine that the referenced file gets read every single time the expression using `file:/path/to/file` needs to be evaluated. But I don’t have an authoritative reference for that. My reason for that assumption is that a function like `tolower` will also need to be executed anew every time an expression using that function gets evaluated. How frequent that is then depends on where you’re using that function. An OS such as Linux keeps frequently accessed files in memory so I wouldn’t expect
HBruijn avatar
in flag
that Apache developers built an custom caching and cache validation layer f into Apache httpd
luzze avatar
cu flag
If it always reads the file on every access on a heavy loaded site there would be the potential for race conditions. Why should I not update the file if I knew it gets read again. On the other hand, as a developer, why should I always read the file if I knew there was the potential for race conditions. I'm astonished about that "much" documentation and comments. I believe nearly nobody uses this function.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.