I have two servers behind a load balancer. Each server is running a memcached server and the settings file (which is identical on both servers) has them both defined (in short: shared cache).
I want the paths to the generated files to be identical on the servers so that the client does not have to download more than once.
For me to get this working I need to understand how django compressor works.
- What is the actual purpose of the cache in django compressor?
- Is the file content stored in both cache and on filesystem?
- If so, which happens first?
- I hope I'm asking the right questions here. Feel free to add some.
A more detailed and better constructed sequence than this would be very helpful.
Edit
- Since the servers both share a memcached server, should I set
COMPRESS_CACHE_KEY_FUNCTION = 'compressor.cache.socket_cachekey'
(see develop branch) or does using the same cache key contribute to my point of having the same file names? - The way I understand this, mtime is collected from the source js/css files to determine if they may have changed and a new file should be generated out of them. Correct?
- This probably does not happen on each and every load. When does it happen?