Django cache is losing keys

I have a Django installation that uses FileSystem caching. The caching system is used by an array of different views. Putting various logs into action for logging when a key is not found in the cache and therefore recovered, I have found that keys are often lost. I don't have a "delete cache" in place and all keys are kept for up to 24 hours, but in the logs they all seem to be regenerated once in a while.

Is there a hidden parameter like "do not store more than n keys" or "more than n megabytes of data" or something else? I'm a little lost because it seems like the keys are lost and I don't know when or why.

Also, I originally chose the cache location "/ tmp / django-cache", so I thought the tmp directory might have been cleared by Linux, but changing the location to "safer" in my home directory doesn't "t change the anomaly.

Also, the full cache directory is about 25MB, so I don't think it cleans up anything because it's too big.

Any idea?

+3


source to share


1 answer


The maximum number of items allowed in the cache before the old values ​​is removed for locmem

, filesystem

and database

backends is 300. You can change it by setting OPTIONS

> MAX_ENTRIES

.

From Django Documentation :



MAX_ENTRIES

: the maximum number of entries allowed in the cache before deleting old values. This argument defaults to 300

.

+2


source







All Articles