Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the files in .sass-cache for?

After playing around with Sass for the first time, I noticed that it leaves a directory .sass-cache behind in my working directory. I don't seem to be able to use the files inside it (in the hashed subdirectories), so what is this directory for?

Can I use it as a VCS, of sorts? Is it safe to delete?

like image 560
KatieK Avatar asked Dec 01 '12 05:12

KatieK


2 Answers

From the Docs:

Sass caches parsed documents so that they can be reused without parsing them again unless they have changed.

It just makes compiling faster. If you delete them they will just be generated again the next time you compile.

like image 181
bookcasey Avatar answered Oct 19 '22 17:10

bookcasey


Sass caches parsed documents so that they can be reused without parsing them again unless they have changed.

Allowing caches to be saved will make help sass compile faster, however if they offend your perfect workspace (like mine), there is a few ways around it.

  1. LOCAL ONLY: For some people the main annoyance of the sassc files is that you might not want them on the live server. If this is the case, you can set filters in most FTP programs (on the local side) to ignore the sass cache directories. (FileZilla can have two separate filters for each view running at the same time, however this will disable directory comparison).

  2. CHANGE CACHE LOCATION: When running sass from the command line use the argument below to change the cache location so it isnt in your way!

    --cache-location PATH

  3. DISABLE CACHE: If cache really bothers you, sass provides an argument to stop caching

    --no-cache

like image 38
Dane Caswell Avatar answered Oct 19 '22 15:10

Dane Caswell