Yii Framework Forum: Some sugestions to improve Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Some sugestions to improve Yii Or funcionalities that i don't find. Rate Topic: -----

#1 User is offline   Dyego Nery 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 26-August 11

Posted 22 May 2012 - 04:11 PM

Hi.

Some suggestions of options that i don't find in Yii. Some of that options can improve the application's performance, and is been used by various web developers.

I'm learning about it, and after a great search into Yii structure folders, i don't find a way to put the tag "defer" in the script tag generated by the Yii. In some cases, this tag could substantially reduce the time for loading scripts. Right now i want to defer the load of the CActiveform widget, but i can't do it.



Other suggestion that i have, and is a question to. I read the tutorial to enable gzip compress to application. But, from what i say, the gzip isn't working to the assets folder. I tried something with .htacces, but don't works to css e js files generated in the assets folder.



Well, I apologize if I'm wrong about these 2 things. If already exists a way to resolve the 2 situations, will be nice if someone show me the solutions.


Sorry for my english.



Hugs.
My first Yii application: http://www.emuitocarro.com.br

http://www.emuitocarro.com.br - Classificado Online de Veículos
0

#2 User is offline   redguy 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 02-July 10
  • Location:Central Poland

Posted 23 May 2012 - 01:13 AM

View PostDyego Nery, on 22 May 2012 - 04:11 PM, said:

Other suggestion that i have, and is a question to. I read the tutorial to enable gzip compress to application. But, from what i say, the gzip isn't working to the assets folder. I tried something with .htacces, but don't works to css e js files generated in the assets folder.


serving static files does not involve running php and Yii so you cannot use same solution for such files as for rendered pages. However you can configure compression on webserver level (in Apache there is mod_deflate) but there must be proper modules installed (if you can administer server confguration you are a winner, if this is shared hosting - there *should* be everything installed but not always).
Read more about mod_deflate (http://httpd.apache....od_deflate.html) I am using it with success to compress static files (assets, js, css, and so on).
red
0

#3 User is offline   Dyego Nery 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 26-August 11

Posted 23 May 2012 - 11:30 AM

thanks redguy.

I'll read about it.

About the "defer" attribute, did you never had this problem? I'm looking for a solution, but until now don't find anything in Yii that let me insert the attribute in the "script" tag.
My first Yii application: http://www.emuitocarro.com.br

http://www.emuitocarro.com.br - Classificado Online de Veículos
0

#4 User is offline   redguy 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 595
  • Joined: 02-July 10
  • Location:Central Poland

Posted 23 May 2012 - 02:18 PM

View PostDyego Nery, on 23 May 2012 - 11:30 AM, said:

thanks redguy.

I'll read about it.

About the "defer" attribute, did you never had this problem? I'm looking for a solution, but until now don't find anything in Yii that let me insert the attribute in the "script" tag.

never used it... but seems there are two solutions:
1. place such scripts in plain html (not using clientScript component)
2. extend CClientScript to handle such scripts (maybe as another script position, like POS_DEFER) and modify rendering procedures...
red
0

#5 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 23 May 2012 - 11:11 PM

Or - if you don't know yet - simply set POS_END which is almost the same behavior.

http://www.yiiframew...riptFile-detail
0

#6 User is offline   Dyego Nery 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 26-August 11

Posted 24 May 2012 - 09:15 AM

Hii Y!!

Yeah, i'm already using the POS_END, but furthermore, my intention is load the scripts after the parsing of the page. Some scripts i wanna call just when i need of them. This is what the "defer" attribute does.
My first Yii application: http://www.emuitocarro.com.br

http://www.emuitocarro.com.br - Classificado Online de Veículos
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users