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
491 stars 53 forks source link

Site.scss in production taking 2.5+ seconds to load #233

Closed kevinklika closed 9 years ago

kevinklika commented 9 years ago

I am confused how caching is supposed to work with this package. I have released my code to production and set the cache var in the configuration file to "prod" to match my environment name, but it appears that the file is being generated for every request? Is there something I should be doing after the launch to production (like publishing assets or something?)

kevinklika commented 9 years ago

I fixed this issue and thought the resolution would be helpful for others.

To enable caching, you must have your ENV set up in the configuration file... There are two lines:

    'cache' =>  array('prod', 'dev', 'local'),
    'concat' => array('prod', 'dev', 'local'),

that must contain your environment name exactly. NOTE: this is what tripped me up! I thought FOR SURE the package specific configuration items would be placed under

/config/{env}/packages/codesleeve/asset-pipeline/config.php

but that is NOT the case! For some reason, in Laravel 4 this configuration file must be under

/config/packages/codesleeve/asset-pipeline/{env}/config.php

putting the correct configuration values in the correct location made caching function totally as expected.