You can use:
Sass::Engine.for_file(scss, options).render
This will check whether there is a cached parse tree in the cache directory for the scss
file hash. See the documentation for Sass::Engine.for_file
here: http://sass-lang.com/docs/yardoc/Sass/Engine.html.
The cache lookup is performed in the Sass::Engine#_to_tree
method, source code available here: https://github.com/nex3/sass/blob/stable/lib/sass/engine.rb.
EDIT
First few lines of Sass::Engine#_to_tree
:
def _to_tree
if (@options[:cache] || @options[:read_cache]) &&
@options[:filename] && @options[:importer]
key = sassc_key
sha = Digest::SHA1.hexdigest(@template)
if root = @options[:cache_store].retrieve(key, sha)
root.options = @options
return root
end
end
# ...
end