0

I have the following setup:

  • Backend web application built in Node.js
  • Frontend web application build in Backbone.js that does Ajax calls to the backend
  • Frontend is using SASS to build CSS that contains images

Now the issue:

Is there anything "out there" in the internet that can version my images and css files, that can be used by / from node.js or express, like there is Sprockets for Ruby?

Details:

By versioning I refer to "image_name"_"sha1_of_the_file".png or something similar, so that every time I change an existing image I would run the "magic script" that will modify the image, and update the css file with it.

PS: I would like to use something already built and not reinvent the wheel if possible, otherwise I could write my own thing

Thanks

Hashem Qolami
  • 93,110
  • 25
  • 145
  • 156
DigitalWM
  • 3,966
  • 3
  • 17
  • 15
  • [**Grunt**](http://gruntjs.com/) or [**Gulp**](http://gulpjs.com/) maybe? – Nick R Feb 19 '14 at 12:48
  • I have previously looked to both. What I also need to mention is that I don't need minify or uglify because for that I use require.js. I also don't need image optimization what I would need is possibility to add versions to images that reside in a CSS and also a version to the CSS. – DigitalWM Feb 19 '14 at 13:03

1 Answers1

0

I think what you are looking for is called cache-busting :

https://github.com/hollandben/grunt-cache-bust

https://stackoverflow.com/questions/24683229/cachebusting-using-grunt-for-multiple-js-files

https://github.com/PaulTondeur/grunt-cache-busting

Community
  • 1
  • 1
Telmo Dias
  • 3,540
  • 2
  • 34
  • 43