Re: Image checks when not using Cachebuster

7 views
Skip to first unread message
Message has been deleted

Christian Johansen

unread,
Dec 27, 2009, 5:42:03 AM12/27/09
to juice...@googlegroups.com
On Tue, Dec 22, 2009 at 18:57, robertbeal <rober...@gmail.com> wrote:
If I set "-c none" in the command when calling Juicer, it doesn't do
the handy image checks (to see if they exist on the disk). I'm running
the command:

juicer merge src/website/res/css/main.css -c none -f -d src/website

Using "-c none" seems to stop "-d src/website" working, I would guess
as Cachebuster is no longer being used. It would still be handy to
have this though.

We can't really rely on cachebuster as we have numerous build agents,
and doing checkouts from svn effects the Last Modified date.

I've done a bit of a hack:

merge.rb line 174

     def cache_buster(file)
       return nil if !file || file !~ /\.css$/
       Juicer::CssCacheBuster.new(:web_root => @web_root, :type =>
@cache_buster, :hosts => @local_hosts)
     end

css_cache_buster.rb line 56

     if !@type.nil?
       File.open(output || file, "w") { |f| f.puts @contents }
     end

So that if "-c none" it still uses the cachebuster lib, but never
actually writes the cachebuster changes. Would it be possible to do a
patch, or lend a hand with writing something more elegant? My hack
works, but I'd rather pull juicer through the repo's rather than
having to patch each build agent.

Hi,

I've gotten feedback from more people that the existence check is nice even though the cache buster feature isn't always needed. I've been refactoring stuff to support the new data-uri feature and in this process I've added an Api for asset paths. I'm thinking perhaps this could be used to check the existence of files without cahce busting them.

The reason that this feature isn't already in place is simply that the checking is merely a side-effect of the fact that the cache buster needs atime to build the URL.

--
MVH
Christian
Reply all
Reply to author
Forward
Message has been deleted
0 new messages