And some other useful config for your squid.conf
file.
# use this if you have a single squid in front of a single Matrix to avoid burying your backend if it's already struggling
retry_on_error off
# This block avoids caching backend related content
acl QUERY urlpath_regex /_edit /_admin /_login /_nocache /_recache /_performance /__lib /__fudge
acl POST method POST
cache deny QUERY
cache deny POST
# if the site experiences high traffic this will be required
# see also "ulimit -n <number of file descriptors>"
max_filedesc 8192
# To ensure we honour cache headers on 404s from Matrix we need to ensure there is
# some positive value in negative_ttl, as long as there is, Squid honours the
# timings set by Matrix.
negative_ttl 1 second