Opened 7 years ago

Closed 4 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@…> 7 years ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by xinbin <xinbin@…>

comment:1 Changed 7 years ago by anonymous

  • Needs documentation set
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 7 years ago by julianb

  • milestone set to post-1.0

comment:3 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:4 Changed 4 years ago by otherjacob

  • Summary changed from added namespace fetures to cache to added 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 4 years ago by julien

  • Type set to New feature

comment:6 Changed 4 years ago by julien

  • Severity set to Normal

comment:7 Changed 4 years ago by Alex

  • Easy pickings unset
  • Resolution set to fixed
  • Status changed from new to closed
  • 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