Yii Framework Forum: Asset manager - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Asset manager

#21 User is offline   Da:Sourcerer 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,269
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 30 April 2012 - 03:03 PM

Just came across this ... Could we have b64'ed hashes in Yii 2 for the assets instead of hexstrings? They tend to be much more compact.
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code

#22 User is offline   Luis Lobo Borobia 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 25-March 10
  • Location:Buenos Aires

Posted 27 May 2012 - 07:53 PM

For CSS caching, we have been using this, successfully:

<?php echo CHtml::cssFile( '/css/main.css?' . filemtime( 'css/main.css' ) ); ?>

Posted Image
The Social Network for Artists

#23 User is offline   fsb 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 09-January 11

Posted 31 May 2012 - 10:16 AM

View Postsamdark, on 30 August 2011 - 02:21 PM, said:

Another ideas from the same Rails pipeline implementation:

1. Allow combining/compressing assets into a single file out of the box in realtime + caching it.
2. Allow pre-processing assets in formats like SCSS into another common format like CSS.

About #1 I think http://www.yiiframew...dedclientscript is pretty close.

Recently I was thinking hard about how to do what the HTML5 Boilerplate Build Script does in a Yii app.

This stuff is really important, especially for mobile.

In Yii 1.1 it is not easy. I don't know what the right design is but I have some thoughts.

Content is much better than file name and mtime for versioning.

There's a design trade off to be made when combining css/js files. We want to maximize the use of caches and minimize the number of requests. If your Yii app's pages all have different combinations of assets but many of the assets are used on multiple pages then combining all assets on a page-by-page basis is a very poor use of caches and bandwidth. So I think the strategy for combining needs to be under the control of the programmer. Perhaps Yii 1.1's CClientScript::$packages is a suitable basis for combinations.

Which reminds me, is Yii2 retaining the separation of CClientScript and CAssetManager? I often feel life would be easier if these were integrated.
tom[] in #yii on freenode.net

Join the happiest place on Freenode: #yii
We've got a MrFisk the bot, Agent Gillette the yii2-docbot, hilarious banter and all kinds of other groovy stuff going on.
Comparison of Internet Relay Chat clients
Web IRC client

Share this topic:

  • (2 Pages)
  • +
  • 1
  • 2
  • 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