views:

885

answers:

1

Can anyone explain a best practice approach to implementing a cache buster in SASS? Meaning, on 'compilation' of my CSS, it appends a timestamp to images files. E.g.,

The following SASS code:

!sprite="gubs.gif"

ul
  li.selected
    :background
      :image= image_url(!sprite)
      :repeat no-repeat
      :position= "right" -222px

Should produce:

ul li.selected {
  background: url(../images/gubs.gif?123456789) no-repeat right -222px
}

In the ruby tool juicer, this is automatically done for you. But I can't seem to find documentation on how to do this in SASS, via Compass.

+1  A: 

Please make sure you are using compass v0.6.5 or greater.

Also, you'll need to make sure you have the images_dir set in your configuration file relative to your project root directory and set http_images_path = :relative.

Once you have done all that, and it's still not working, the best place to get support is the compass mailing list.

-chris

chriseppstein
I have the latest v0.6.15, and also :relative set. There is still no cache buster appended to the image paths. I guess this is really just a missing feature in SASS? Thanks for your answer though!
Jason