Developer forum

Forum » Feature requests » getimage.aspx for css and js

getimage.aspx for css and js


Reply
Am I the only one, who thinks it could be really cool, if you could do something like

(link rel="stylesheet" type="text/css" href="/admin/public/minify.aspx?file=mystylesheet.css")

or

(script src="/admin/public/minify.aspx?file=myscripts.js" type="text/javascript")(/script)

In that way you can still edit your css and js-files directly on the server, without having to go through some minifying app, and then uploading the new minified files to the server.

This could also make room for a LESS or SASS compiler :)

Replies

 
Reply
Hi,

That's a brilliant idea. I was struggling to find a way to suggest such a tool and your approach is simply perfect. Let's see if the dw guys think so too :P

Could also be great if it could take some parameters and minify more than 1 file or a feature in the backend that would minify all js and css files in the head.

Nuno
 
Reply

This would be a pretty cool and useful feature for optimizing performance.
 

 
Reply

Hi guys,

I've just posted an article on my blog describing the functionality that you're looking for:

http://volpav.wordpress.com/2011/03/28/combine-and-compress-your-stylesheet-and-script-files/

-- Pavel

 
Reply
works like a charm.
Went from F grade to B grade on compression with it.

Pavel, there's only one problem, the validator W3 could not validate the code:

Warning Line 13, Column 73: cannot generate system identifier for general entity "BasePath"
Error Line 13, Column 73: general entity "BasePath" not defined and no default entity
Error Line 13, Column 81: reference to entity "BasePath" for which no system identifier could be generated
Error Line 13, Column 118: general entity "Files" not defined and no default entity

Is there anything to do about that?

 
Reply
If you're embedding resources statically ("Method #1" from my article) then you should probably edit the URL pointing to resource handler by replacing ampersands (&) with the corresponding HTML entities (&).

If you're using method #2 then it's our problem - will fix it asap.

I'll edit my post to reflect this change.

-- Pavel
 
Reply
Great, that worked :-) I was using method 1. the direct URL in the HTML.

(It said in the validator that the problem was an unencoded ambersand anyway).
 
Reply
Hi Pavel,

From what I noticed, the handler basically merges files together. Is there a parameter that would engage minification?

Nuno
 
Reply
Hi Nuno,

Currently there is no support for minification. But I will associate a new work item with your feature request.

-- Pavel
 
Reply
Hi Pavel,

That would be perfect. Thanks a lot.

Nuno
 
Jacob Storgaard Jensen
Reply

Hi Pavel, did you get to the minification part of this? I know Nuno and his team did a really great solution themselves, which it sounded like they already sent to you guys to just drop into all installations... Could we please have that one installed instead/too?