I'm trying to setup squid proxy in a kubernetes environment as a caching server with 3 replicas. I wanted to know whether all three replicas can share the same disk storage, or I'll have to assign separate storage to each. Currently all three of them have this in the config:
cache_dir ufs /var/spool/squid 100 16 256
All three replica mount the same volume, so /var/spool/squid/ is shared among the three. This works in the sense that cached object takes space only once but the first request to each replica is always a miss. I am not sure if there are any downsides to configuring it like this, or if I should configure them to use separate storage(a Statefulset).
TL;DR: Can multiple squid instances share the same cache_dir?