Skip to content

Assets still get compiled on-demand in production #345

@benmelz

Description

@benmelz

I noticed this working on #342 and it sent me down a wild rabbit hole.

For whatever reason, it appears that invoking Sprockets::Environment#find_asset will trigger a compile if there is no digested asset in sprockets' in memory cache.

This applies to the computation of a digested file name so even though we have precompiled assets served by apache, the very invocation of %link{ rel: :stylesheet, href: asset_path('application.css') } when rendering the layout triggers a compile internally.

Not a huge deal currently since the deployment currently has node_modules/ in tact, but it immediately made itself known when running in a container where that gets specifically stripped out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions