Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recompiling on reach request #55

Open
kendagriff opened this issue Jun 30, 2013 · 8 comments
Open

Recompiling on reach request #55

kendagriff opened this issue Jun 30, 2013 · 8 comments

Comments

@kendagriff
Copy link
Contributor

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?

@kendagriff
Copy link
Contributor Author

Reverting to 0.3.0 seems to fix the problem.

@pbiggar
Copy link
Contributor

pbiggar commented Jul 3, 2013

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.

@kendagriff
Copy link
Contributor Author

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.

@kendagriff
Copy link
Contributor Author

Is it possible this is also fixed in the master branch?

@pbiggar
Copy link
Contributor

pbiggar commented Jul 5, 2013

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!

@kendagriff
Copy link
Contributor Author

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...

@kendagriff
Copy link
Contributor Author

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.

@kendagriff kendagriff reopened this Jul 5, 2013
@pbiggar
Copy link
Contributor

pbiggar commented Jul 6, 2013

Can you post your dieter-options? Do you have :precompiles specified?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants