Problem cache for template files (.ejs)

64 views
Skip to first unread message

Tom

unread,
Sep 8, 2010, 6:46:47 AM9/8/10
to JavaScriptMVC
Hello,

We load our javascriptMVC in production mode but all template still
load indepedently. We don't know where templates files are loaded so
we can't control the cache management of those files.

What we want to know is:
> Where are loaded template files (steal.js?) ?
> Is it normal that template files are loaded indepedently ?

Thanks !

Tom

Alexandre Gomes

unread,
Sep 8, 2010, 8:21:19 AM9/8/10
to javasc...@googlegroups.com
You have to include your views with steal like this:

steal.plugins(
'jquery/controller', ...)
.css(...)
.resources(...)
.models(...)
.controllers(...)                     
.views('//path/to/view1',
         '//path/to/view2', ...)  


--
You received this message because you are subscribed to the Google Groups "JavaScriptMVC" group.
To post to this group, send email to javasc...@googlegroups.com.
To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javascriptmvc?hl=en.


Tom

unread,
Sep 8, 2010, 8:46:27 AM9/8/10
to JavaScriptMVC
Thank you very much for your answer.

We already load all our views by this way. Maybe i have not been
enough specific in my previous post.

We need to load ours .ejs files with a version parameter like:
http://website.com/project/views/folder/template.ejs?v=123456

So, to be specific, how can we add the ?v=123456 to all URLs who
load .ejs files.

Thanks again !

Tom

PS: We use javascriptMVC V3.0
> > javascriptmv...@googlegroups.com<javascriptmvc%2Bunsubscribe@goog legroups.com>
> > .

Alexandre Gomes

unread,
Sep 8, 2010, 9:01:25 AM9/8/10
to javasc...@googlegroups.com
I'm not 100% sure about this so maybe someone can correct me if I'm wrong:

Maybe you can try this after loading all your plugins/models/controllers/views:

    .then(function () {
        $.View.types['.ejs?v=12345'] = $.View.types['.ejs'];
        $.View.ext = ".ejs?v=12345"
...

And then load your views without any suffix (path/to/view instead of path/to/view.ejs)

To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.

Justin Meyer

unread,
Sep 8, 2010, 9:16:45 AM9/8/10
to javasc...@googlegroups.com
Why are you doing this?

Sent from my iPhone

> To unsubscribe from this group, send email to javascriptmv...@googlegroups.com.

Tom

unread,
Sep 8, 2010, 10:04:10 AM9/8/10
to JavaScriptMVC
Hello,

We want to do this to have a cross-browser solution to handle our
browser cache management.

We did the solution of Alexandre and it works.

Thank you for all !

Tom

On Sep 8, 3:16 pm, Justin Meyer <justinbme...@gmail.com> wrote:
> Why are you doing this?
>
> Sent from my iPhone
>
Reply all
Reply to author
Forward
0 new messages