On the other hand, *theoretically*, you might dynamically generate your
JavaScript file. In which case, templates is the correct answer.

Not suggesting that's advisable or not, just more or less adding on to
Dan's advice for completeness. Use the right tool for the job, as he said.

On Tue, Oct 2, 2018, 5:37 PM Dan Book <[email protected]> wrote:

> Use the right tool for the job - your javascript files aren't templates,
> so serve them as static files. The main benefit of serving static files is
> that the browser can cache them until they're next modified.
>
> -Dan
>
> On Tue, Oct 2, 2018 at 6:24 PM Viktor Nacht <[email protected]>
> wrote:
>
>> For Mojolicious, are there any best practices or compelling arguments for
>> putting scripts in templates vs static files in the public directory? I do
>> plan on eventually using AssetPack to serve them combined and minified.
>> Just curious what most other people do.
>>
>> V
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Mojolicious" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/mojolicious.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to