Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8599237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:21:15+00:00 2026-06-12T01:21:15+00:00

I have a Heroku setup with django-compressor compressing my CSS and JS files. My

  • 0

I have a Heroku setup with django-compressor compressing my CSS and JS files. My default cache backend is set up with memcached (actually Memcachier when on Heroku). My static files are being served on an Amazon S3 instance (handled by django-storages and boto). Generally my setup is in line with this one from the django-compressor docs.

In my pages, the links to my compressed files have an “expires” query that seems to be an hour from when the link is generated. I don’t want to set there to be no expiration for all CSS or JS requests because I have some CSS and JS that I don’t compress (it gives me errors when I try… probably a different question).

However, once an hour the links break and the site has no more styles or JS. It looks like the link, or at least the expires header, is being cached and not regenerated, so after the time in the expires argument passes, Amazon no longer returns the file. If I flush the memcache, it changes the expires header in the link to an hour from then, which fixes the problem for an hour, until it expires again.

Here is an example of a link that was generated around 1:39 PM EST today, Tuesday, September 18: https://zen180-static.s3.amazonaws.com/CACHE/css/68d31794a646.css?Signature=u%2FTxeF7LBBZTDV79YovOjoK2tcw%3D&Expires=1347993542&AWSAccessKeyId=AKIAIJ7VKLEX7HIMJZCA. After it is first generated, the page continues to serve that link without alteration. Around 2:39 EST (i.e. the Unix time 1347993542, from the expires argument in the URL), that link stopped working and sent back an “Expired” XML message (the same one it does now). But the bad link was still there on my page until I flushed memcache.

Here are the relevant settings:

COMPRESS_ENABLED = True

STATICFILES_STORAGE = '[my app's name].storage.CachedS3BotoStorage' (a subclass of S3BotoStorage that is almost identical to the one from django-compressor's docs linked above)

COMPRESS_STORAGE = STATICFILES_STORAGE

COMPRESS_URL = STATIC_URL

CACHES = {
  'default': {
    'BACKEND': 'django_pylibmc.memcached.PyLibMCCache',
    'LOCATION': 'localhost:11211',
    'TIMEOUT': 500,
    'BINARY': True,
  }
}

Here is the error:

<Error>
<Code>AccessDenied</Code>
<Message>Request has expired</Message>
<RequestId>81A63F24378ECB5E</RequestId>
<Expires>2012-09-18T18:39:02Z</Expires>
<HostId>lIr5l9Fna95DUfk6hUsWqhO5EQNn6Ayu8BatpEavis8YzLvsaJRru4O8P/50pgMy</HostId>
<ServerTime>2012-09-18T18:59:51Z</ServerTime>
</Error>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:21:16+00:00Added an answer on June 12, 2026 at 1:21 am

    If you want the browser to cache your static content, set the settings.AWS_HEADERS accordingly (as outlined in Amazon’s best practices):

    AWS_HEADERS = {
        'Expires': 'Sun, 19 Jul 2020 18:06:32 GMT'
    }
    

    If you really need the link to be regenerated, find the place it is stored in memcache and set the same cache time you send as link expiration time to Amazon (judging from django-compressor docs it should be one of settings.COMPRESS_*_DELAY).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a unique set-up I am trying to determine if Heroku can accommodate.
I have a heroku app, that's like the default, but I want to deploy
I have a Rails app running Mongoid on Heroku and I need to set
Good night fellas, I'm trying to setup a app with django on Heroku using
I'm trying to setup a test Django project on Heroku. Following the advice here
I have a django app deployed on heroku that needs to make POST requests
I'm trying to set up Redis on Heroku as a backend for Celery. I
I am trying to setup Amazon S3 with paperclip on heroku. I have everything
I have Less CSS working with my Django site in local development. Everything looks
So I have Resque and redis to go set up on Heroku and this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.