diff --git a/django/contrib/staticfiles/storage.py b/django/contrib/staticfiles/storage.py
index 0293363..ac83f52 100644
a
|
b
|
class CachedFilesMixin(object):
|
105 | 105 | hashed_name, fragment = name, '' |
106 | 106 | else: |
107 | 107 | clean_name, fragment = urldefrag(name) |
108 | | cache_key = self.cache_key(name) |
109 | | hashed_name = self.cache.get(cache_key) |
110 | | if hashed_name is None: |
111 | | hashed_name = self.hashed_name(clean_name).replace('\\', '/') |
112 | | # set the cache if there was a miss |
113 | | # (e.g. if cache server goes down) |
114 | | self.cache.set(cache_key, hashed_name) |
| 108 | if urlsplit(clean_name).path.endswith('/'): # don't hash paths |
| 109 | hashed_name = name |
| 110 | else: |
| 111 | cache_key = self.cache_key(name) |
| 112 | hashed_name = self.cache.get(cache_key) |
| 113 | if hashed_name is None: |
| 114 | hashed_name = self.hashed_name(clean_name).replace('\\', '/') |
| 115 | # set the cache if there was a miss |
| 116 | # (e.g. if cache server goes down) |
| 117 | self.cache.set(cache_key, hashed_name) |
115 | 118 | |
116 | 119 | final_url = super(CachedFilesMixin, self).url(hashed_name) |
117 | 120 | |
diff --git a/tests/regressiontests/staticfiles_tests/tests.py b/tests/regressiontests/staticfiles_tests/tests.py
index 680027b..9834885 100644
a
|
b
|
class TestCollectionCachedStorage(BaseCollectionTestCase,
|
317 | 317 | "/static/test/file.ea5bccaf16d5.txt") |
318 | 318 | self.assertStaticRenders("cached/styles.css", |
319 | 319 | "/static/cached/styles.93b1147e8552.css") |
| 320 | self.assertStaticRenders("path/", |
| 321 | "/static/path/") |
| 322 | self.assertStaticRenders("path/?query", |
| 323 | "/static/path/?query") |
320 | 324 | |
321 | 325 | def test_template_tag_simple_content(self): |
322 | 326 | relpath = self.cached_file_path("cached/styles.css") |