Calculating the volume of data in caches

Is it possible to calculate the volume of data (MB, GB, TB etc) which gets stored in cache writers? We have a protocol which uses a number of caches which then uploads the data into a Postgres database which compresses the data.