Django-compressor: You have offline compression enabled but key "cdfe134683bd23a2ea9de19b46490a13" is missing from offline manifest.

Created on 9 May 2014  ·  3Comments  ·  Source: django-compressor/django-compressor

Ok figured I would post this here before I waste countless hours of my life trying to fix something someone might have an easy answer to. We are using django-compressor and are having issues when we set COMPRESS_OFFLINE = True. We seem to error below at random. Sometimes the page loads and sometimes it does not. It works perfectly fine with COMPRESS_OFFLINE = False.

You have offline compression enabled but key "cdfe134683bd23a2ea9de19b46490a13" is missing from offline manifest.

Here is a little details on our setup.

Django 1.6.3
django-compressor 1.3
google-cloud-storage 0.3
Nginx
Gunicorn

We are using google cloud to serve static content including the cache for compressor. Here are our settings for compressor.

STATIC_URL = 'https://xxxxx.storage.googleapis.com/static/'

COMPRESS_ENABLED = True

COMPRESS_OFFLINE = True
COMPRESS_STORAGE = 'google_folder_storage.google.CacheStorage'
CACHE_GOOGLE_PATH = "cache"
COMPRESS_URL = STATIC_URL
COMPRESS_CSS_FILTERS = [
    'compressor.filters.css_default.CssAbsoluteFilter',
    'compressor.filters.cssmin.CSSMinFilter',
]

Most helpful comment

It usually means you have dynamic content inside your {% compress %} blocks, or variables you didn't pass to COMPRESS_OFFLINE_CONTEXT. Would need to see more to debug, like your templates, manifest etc.

All 3 comments

I did pinpoint the problem to be with {% compress js inline %} I guess I just won't use that for now

It usually means you have dynamic content inside your {% compress %} blocks, or variables you didn't pass to COMPRESS_OFFLINE_CONTEXT. Would need to see more to debug, like your templates, manifest etc.

There was a couple issues. The first one was we had our GS_FILE_OVERWRITE = False which was creating a different version of the manifest each time we complied it. For example is was making a manifest_1.json. We solved that by creating a compress_settings.py with GS_FILE_OVERWRITE = True and just running the command with that settings file.

The next issue was caused by having variables in the {% compress js inline %}. I guess this issue can be closed now.

Was this page helpful?
0 / 5 - 0 ratings