Recompiling on reach request
kendagriff opened this issue · 8 comments
In production it's recompiling the assets with each request:
(def asset-config-options {:engine :v8
:compress true
:cache-mode :production
:asset-roots ["resources"]
:cache-root "resources/asset-cache"
:log-level :normal})
The timestamp changes with each request. I'm using link-to-asset
as instructed.
Am I missing something?
Reverting to 0.3.0 seems to fix the problem.
What filename was in the link-to-asset, and what filenames existed on the system? Is this the same problem from #9 (comment)? If so, I think we should look at a documentatin fix.
Okay, I don't believe this is related to #9. Even with a patched version of 0.4.0, Dieter with cache-mode
set to :production
recompiles CSS and JS on each request.
FYI: I'm not precompiling, just having it compile at run time.
Is it possible this is also fixed in the master
branch?
I intended :production to be used with precompilation - I didn't consider that it might compile once and cache. I think.
I'll definitely take a patch for this. Thanks!
Ah, that makes sense. I think precompilation is the better long-term solution for most projects anyway.
Perhaps its behavior is simply worth documenting. Many of us (me included) come from Rails' asset pipeline, which, if it cannot find cached assets in production at runtime, it makes them.
I'm still too unfamiliar with Dieter's internals, so I'd be happy to document the behavior, and perhaps submit a patch when I can navigate the code a bit better...
I don't mean to be such a pest; I'm just struggling to understand the workflow.
I set cache-mode
to :development
, nothing is precompiled to the cache, as expected. I run lein dieter-precompile
, however, and no files are generated. It runs, but nothing is generated and placed into the cache-root
as the documentation states. No errors, nuthin'.
If I change cache-mode
to :production
, it does generate precompiled files, and stashes them in cache-root
. But, as I mentioned earlier, it will regenerate the files with each request.
There's either a bug, or I'm missing something simple. I'd be happy to patch up documentation for other noobs like me.
Can you post your dieter-options? Do you have :precompiles
specified?