Opened 9 years ago

Closed 5 years ago

#6847 closed New feature (fixed)

added namespace fetures to filebased cache

Reported by: xinbin <xinbin@…> Owned by: nobody
Component: Core (Cache system) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In my project, I will generate more than 1000,000 cache files to avoid the list page querying database. So many files lying in a single directory is not a good thing.
I begin to think if there's a way diving them to different directories, just like namespace. Unluky, I found nothing in google. I beigin to modify the core code.
Finally I succeed, the changes are in a file (D:\Python25\Lib\site-packages\django\core\cache\backends\filebased.py):

  1. remove urllib.quote_plus to the ky;
  2. create dirs due to namespace.

But I think it will be great if offical adds the feature.

Attachments (1)

filebased.py (2.5 KB) - added by xinbin <xinbin@…> 9 years ago.

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by xinbin <xinbin@…>

Attachment: filebased.py added

comment:1 Changed 8 years ago by anonymous

Needs documentation: set
Needs tests: set
Patch needs improvement: unset
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 8 years ago by Julian Bez

milestone: post-1.0

comment:3 Changed 8 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 Changed 6 years ago by otherjacob

Summary: added namespace fetures to cacheadded namespace fetures to filebased cache

clarifying the ticket -- #13795 adds "namespace" features for most caches, but this is specific to filebased cache backend.

I may be able to pick this up for 1.4

comment:5 Changed 5 years ago by Julien Phalip

Type: New feature

comment:6 Changed 5 years ago by Julien Phalip

Severity: Normal

comment:7 Changed 5 years ago by Alex Gaynor

Easy pickings: unset
Resolution: fixed
Status: newclosed
UI/UX: unset

This appears to have been done at some point, django computes the md5 of teh key, and creates sub directories for teh first two, and second two characters of it.

Note: See TracTickets for help on using tickets.
Back to Top