laurilehmijoki / s3_website

Manage an S3 website: sync, deliver via CloudFront, benefit from advanced S3 website features.
Other
2.24k stars 187 forks source link

How to check if cache control is enabled? #214

Closed iloveip closed 8 years ago

iloveip commented 8 years ago

Hi there,

I added the following code to my s3_config.yml file in Jekyll site:

max_age:
  "css/fonts/*": 6000
  "*": 300

Then I ran s3_website push --force. But when I check the site through Google Page Speed it still says that I need to enable cache control.

Is there any way to check if cache control has already been enabled on my site? How long does it takes for it to take effect after force push?

manabusakai commented 8 years ago

Hi, @iloveip.

Please check the HTTP header (ex. Cache-Control: max-age=86400) It is convenient to Chrome and Firefox developer tools.

iloveip commented 8 years ago

Hi @manabusakai,

Thank you very much for your reply. It says Cach-Control is set to public, max-age=300. But I keep getting a message in Google Page Speed Insights to enable cache control.

Any ideas how I can fix it?

manabusakai commented 8 years ago

That’s all right!

I found this description in the official reference.

We recommend a minimum cache time of one week and preferably up to one year for static assets, or assets that change infrequently.

Please extend the period. I think the resolve.

iloveip commented 8 years ago

@manabusakai thank you very much!

So one week would be max-age=604800?

manabusakai commented 8 years ago

So one week would be max-age=604800?

That's right!

iloveip commented 8 years ago

@manabusakai thank you very much! Everything is working now.

manabusakai commented 8 years ago

That's great! :smile: