[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Javascript trigger design



On Fri, Nov 28, 2014 at 10:30:40AM +0100, Tomas Pospisek wrote:
> Am 28.11.2014 um 08:19 schrieb Matthias Urlichs:
> > Hi,
> > 
> > Tomas Pospisek:
> >> At least the Ruby On Rails framework notices an updated JS and will
> >> re-compress the whole JS blob from its parts.
> > 
> > Does it call stat() on every constituent of these packed JS files on every
> > web request, or does it do that with a periodic background checker?
> 
> I do not know. Now that I am reading the answers in this thread I'm
> noticing that RoR might be checking the newness of JS scripts depending
> on the mode it's running in (production, testing, dev). In which case
> the trigger mechanism could come into play again. So maybe my statement
> was mistaken. In case anybody intends to make conclusions, s/he really
> needs to look these detail up in the RoR docu.
> *t

In development mode, it will always serve the latest version of those
files in a way that is transparent to the developer, but of course that
has a cost.

For production usage, Rails provides a build-time task that you run to
compile/minify the static assets. So a packaged app should probably run
such task during its postinst; using triggers is a perfect way of
solving this.

Note however that this feature (calle assets pipeline) is optional and
not all Rails apps will use it. Redmine for instance doesn't, partially
because it exists since before the asset pipeline was introduced and
migrating to use it is not always super convenient.

-- 
Antonio Terceiro <terceiro@debian.org>

Attachment: signature.asc
Description: Digital signature


Reply to: