CodeSleeve / asset-pipeline

This Laravel 4 package provides a very simple and easy to use asset pipeline. It was heavily inspired by the Rails asset pipeline. We make use of the wonderful Assetic package to help with pre-compliation!
http://www.codesleeve.com
MIT License
489 stars 53 forks source link

Browser cache support #90

Closed krzysztofantczak closed 10 years ago

krzysztofantczak commented 10 years ago

I was trying to force my browser to cache assets served by asset-pipeline, but with each request i was getting code 200 and assets was served like they was modified but they wasn't. So it seems that pipeline doesn't supports if-modified-since header or i'm doing something wrong. This is my relevant htaccess part which i'm trying to use:

ExpiresActive On
ExpiresDefault "access 1 month"

Anyone can help with that?

kdocki commented 10 years ago

This is correct. Currently it runs through the laravel controller and returns a 200 ... it doesn't do 304 redirects yet because I haven't figured out a good way to do this without confusing the crap out of people. That is to say, if you update your production code and your assets have changed, the 304 on the client side doesn't get updated properly. I would be open to suggestions on this, and in v1.3 I implemented etags and had a client_cache configuration option but I took it out in v1.4 cuz it was causing more harm than good.

kdocki commented 10 years ago

Got some community help on this so I may be bringing this in it works... https://github.com/CodeSleeve/asset-pipeline/issues/96 I'm going to close this issue and keep the other one open so we don't have duplicate requests.