[bug][fix]dojo/dijit modules aren't cached

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
gitawego
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 08 May 2013, 00:35

[bug][fix]dojo/dijit modules aren't cached

Postby gitawego » 14 May 2013, 20:58

I noticed the dijit modules are compressed in tt-rss-layer.js, but the are not cached by function require. (that's why your boot time is slow even all the js files are minified)
based on your code, you can simply add this code before your init(), or append it to the tt-rss-layer.js

Code: Select all

//this tells dojo's require to cache all the predefined modules.
require({cache:{}});


btw, you must remove

Code: Select all

"lib/dijit/dijit.js",
in your scripts array, dijit is already included in tt-rss-layer.js. and it's not in cache mode, which means as soon as the define method called, it will try to load the dependencies based on your package definition.

PS: I suggest you use async mode (in dojo) in order to facilitate the UI development.
Last edited by gitawego on 14 May 2013, 21:18, edited 1 time in total.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [bug][fix]dojo/dijit modules aren't cached

Postby fox » 14 May 2013, 21:18

Please make a pull request, thanks.

gitawego
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 08 May 2013, 00:35

Re: [bug][fix]dojo/dijit modules aren't cached

Postby gitawego » 14 May 2013, 21:30

done..
thanks for your amazing project ^^
and I love dojo ;)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [bug][fix]dojo/dijit modules aren't cached

Postby fox » 14 May 2013, 22:07

Thanks! Hope this makes startup faster.

Edit: same thing is probably needed for prefs.php

gitawego
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 08 May 2013, 00:35

Re: [bug][fix]dojo/dijit modules aren't cached

Postby gitawego » 14 May 2013, 22:23

yes, indeed, have to do the same thing for perfs.php, but it's a little bit tricky.
I send a pull request

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [bug][fix]dojo/dijit modules aren't cached

Postby fox » 14 May 2013, 23:21

Seems to work fine, thanks!

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: [bug][fix]dojo/dijit modules aren't cached

Postby feader » 14 May 2013, 23:59

Don't know the significance of that, but after the latest commit (010eb9c169f34163c66a0823936372869ad3f606), I have a warning in the error log

Code: Select all

E_WARNING (2)   include/functions.php:4131   file_put_contents(cache/js/../lib/CheckBoxTree.js): failed to open stream: No such file or directory

which seems to be caused by the third change in that commit. It still runs fine though, I checked the error log only because the fetch time seemed a bit long.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [bug][fix]dojo/dijit modules aren't cached

Postby fox » 15 May 2013, 00:08

Most probably get_minifed_js() needs to do basename() on cached file.

feader
Bear Rating Master
Bear Rating Master
Posts: 160
Joined: 26 Dec 2012, 20:03

Re: [bug][fix]dojo/dijit modules aren't cached

Postby feader » 15 May 2013, 00:26

fox wrote:Most probably get_minifed_js() needs to do basename() on cached file.

Yes. :oops:


Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests