Hi,

The COMPRESS_OFFLINE_MANIFEST is to set the name of the manifest, default 
is manifest.json
this issue isn't that the server can't find the manifest, it finds the 
correct one but downloads (I think) it every request..

On Tuesday, December 16, 2014 4:49:22 AM UTC+2, Collin Anderson wrote:
>
> Hi Guy,
>
> I haven't used django_compressor, but it might help to configure 
> COMPRESS_OFFLINE_MANIFEST.
>
> Collin
>
> On Saturday, December 13, 2014 11:54:27 AM UTC-5, Guy Tamir wrote:
>
> I haven't configured django caching, how do I do that?
>
> Also - CachedS3BotoStorage is this:
>
> from django.core.files.storage import get_storage_class
> from storages.backends.s3boto import S3BotoStorage
>
>
> from django.core.files.base import File
>
>
> class CachedS3BotoStorage(S3BotoStorage):
>     """
>     S3 storage backend that saves the files locally, too.
>     """
>     def __init__(self, *args, **kwargs):
>         super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
>         self.local_storage = get_storage_class(
> "compressor.storage.CompressorFileStorage")()
>
>
>     def save(self, name, content):
>         name = super(CachedS3BotoStorage, self).save(name, content)
>         self.local_storage._save(name, content)
>         return name
>
>
> On Friday, December 12, 2014 5:09:16 PM UTC+2, Collin Anderson wrote:
>
> Hi,
>
> Do you have django caching configured? If not, then caching will only be 
> per-process and each process will need to fetch the information. (I'm 
> assuming CachedS3BotoStorage uses django's cache.)
>
> Collin
>
> On Wednesday, December 10, 2014 11:05:35 AM UTC-5, Guy Tamir wrote:
>
> Hey all,
>
> I'm trying to add django-compressor into my app.
> I'm deploying to Heroku.
>
> This is the code in my Settings file
> AWS_QUERYSTRING_AUTH = False
> AWS_STORAGE_BUCKET_NAME = os.environ.get('BUCKET_NAME')
>
> conn = S3Connection(AWS_ACCESS_KEY, AWS_SECRET_KEY,host="
> s3-us-west-1.amazonaws.com")
> STATIC_ROOT = 'static'
> COMPRESS_ROOT = 'static'
>
>
>
> COMPRESS_CSS_FILTERS = ['compressor.filters.yuglify.YUglifyCSSFilter',
> 'compressor.filters.cssmin.CSSMinFilter']
> COMPRESS_JS_FILTERS = ['compressor.filters.jsmin.JSMinFilter'] 
> #,'compressor.filters.jsmin.SlimItFilter'
> COMPRESS_OUTPUT_DIR = 'compressed'
> COMPRESS_CSS_BACKEND = 'django_compressor.css.CssCompressor'
> COMPRESS_JS_BACKEND = 'django_compressor.js.JsCompressor'
> COMPRESS_OFFLINE = True
> COMPRESS_ENABLED = True
>
>
> if DEBUG:
>     STATIC_URL = '/static/'
> else:
>     AWS_S3_CUSTOM_DOMAIN = os.environ.get('COMPRESS_URL') # cdn.test.com
>     STATIC_URL =  'http://' + AWS_S3_CUSTOM_DOMAIN + '/'
>     STATICFILES_STORAGE = 'myapp.CachedS3BotoStorage.CachedS3BotoStorage'
>     COMPRESS_STORAGE = 'myapp.CachedS3BotoStorage.CachedS3BotoStorage'
>
>
> COMPRESS_URL = STATIC_URL
>
>
> I ran the compress command locally and then deployed to Heroku.
> When I see my deployed pages I can see in the source files that the 
> browser is using the compressed css and js file like expected.
>
> My problem is that when I see my logs from Heroku, each time that I 
> refresh a page, it seems like Heroku goes and fetches the manifest.json 
> file from my S3 bucket.
> This obviously slows down the requests..
>
> Logs from Heroku:
> 2014-12-10T16:01:14.087225+00:00 app[web.1]: DEBUG:boto:Token: None
> 2014-12-10T16:01:14.086183+00:00 app[web.1]: DEBUG:boto:auth
> _path=/test-dollarsocial/compressed/manifest.json
> 2014-12-10T16:01:14.137618+00:00 heroku[router]: at=info method=GET path=
> "/login/" host=test-dollar-social.herokuapp.com request_id=bede0d95-e9b6-
> 4453-95b3-438606fc7e62 fwd="93.172.158.119" dyno=web.1 connect=1ms service
> =194ms status=200 bytes=13248
> 2014-12-10T16:01:14.051410+00:00 app[web.1]: DEBUG:boto:Using secret key 
> provided by client.
> 2014-12-10T16:01:14.051322+00:00 app[web.1]: DEBUG:boto:Using access key 
> provided by client.
> 2014-12-10T16:01:14.051990+00:00 app[web.1]: DEBUG:boto:path=/compressed/
> manifest.json
> 2014-12-10T16:01:14.052126+00:00 app[web.1]: DEBUG:boto:auth_path=
> /test-dollarsocial/compressed/manifest.json
> 2014-12-10T16:01:14.052405+00:00 app[web.1]: DEBUG:boto:Path: /compressed/
> manifest.json
> 2014-12-10T16:01:14.052316+00:00 app[web.1]: DEBUG:boto:Method: HEAD
> 2014-12-10T16:01:14.052490+00:00 app[web.1]: DEBUG:boto:Data:
> 2014-12-10T16:01:14.052605+00:00 app[web.1]: DEBUG:boto:Headers: {}
> 2014-12-10T16:01:14.052734+00:00 app[web.1]: DEBUG:boto:Host: test-
> dollarsocial.s3.amazonaws.com
> 2014-12-10T16:01:14.052828+00:00 app[web.1]: DEBUG:boto:Params: {}
> 2014-12-10T16:01:14.052970+00:00 app[web.1]: DEBUG:boto:establishing 
> HTTPS connection: host=test-dollarsocial.s3.amazonaws.com, kwargs={
> 'timeout': 70}
> 2014-12-10T16:01:14.053082+00:00 app[web.1]: DEBUG:boto:Token: None
> 2014-12-10T16:01:14.053224+00:00 app[web.1]: DEBUG:boto:StringToSign:
> 2014-12-10T16:01:14.053227+00:00 app[web.1]: HEAD
> 2014-12-10T16:01:14.053228+00:00 app[web.1]:
> 2014-12-10T16:01:14.053230+00:00 app[web.1]:
> 2014-12-10T16:01:14.053231+00:00 app[web.1]: Wed, 10 Dec 2014 16:01:14 GMT
> 2014-12-10T16:01:14.053233+00:00 app[web.1]: /test-dollarsocial/compressed
> /manifest.json
> 2014-12-10T16:01:14.085443+00:00 app[web.1]: DEBUG:boto:path=/compressed/
> manifest.json
> 2014-12-10T16:01:14.086354+00:00 app[web.1]: DEBUG:boto:Method: HEAD
> 2014-12-10T16:01:14.086473+00:00 app[web.1]: DEBUG:boto:Path: /compressed/
> manifest.json
> 2014-12-10T16:01:14.086576+00:00 app[web.1]: DEBUG:boto:Data:
> 2014-12-10T16:01:14.086685+00:00 app[web.1]: DEBUG:boto:Headers: {}
> 2014-12
>
> ...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/413187c1-e8e6-41ed-af7f-fbb75d058c0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to