Squid -k rotate to ‘clear squid cache’
This description from Squid FAQ
Cache/Log (Squid 1.x) or Swap.State (Squid 2.x)
This file has a rather unfortunate name. It also is often called the swap log. It is a record of every cache object written to disk. It is read when Squid starts up to “reload” the cache. If you remove this file when squid is NOT running, you will effectively wipe out your cache contents. If you remove this file while squid IS running, you can easily recreate it. The safest way is to simply shutdown the running process:
% squid -k shutdown
This will disrupt service, but at least you will have your swap log back. Alternatively, you can tell squid to rotate its log files. This also causes a clean swap log to be written.
% squid -k rotate
For Squid-1.1, there are six fields:
fileno: The swap file number holding the object data. This is mapped to a pathname on your filesystem.
timestamp: This is the time when the object was last verified to be current. The time is a hexadecimal representation of Unix time.
expires: This is the value of the Expires header in the HTTP reply. If an Expires header was not present, this will be -2 or fffffffe. If the Expires header was present, but invalid (unparsable), this will be -1 or ffffffff.
lastmod: Value of the HTTP reply Last-Modified header. If missing it will be -2, if invalid it will be -1.
size: Size of the object, including headers.
url: The URL naming this object.
You will not lose your entire cache when you remove the swap.state while Squid is not running,. Squid will scan all of the cache directories and read each swap file to rebuild the cache. You’ll have to be patient because this can take a very long time
By default the swap.state file is stored in the top-level of each cache_dir. You can move logs to different locations with the cache_swap_log option.
Related posts:





You have a point. Very insightful. A nice different perspective