Sponsored Content
Full Discussion: Optimizing JS and CSS
Top Forums Web Development Optimizing JS and CSS Post 303030914 by Akshay Hegde on Tuesday 19th of February 2019 06:40:10 AM
Old 02-19-2019
Quote:
Originally Posted by Neo
Hi Akshay,

First, let me say that I normally minimize CSS and Javascript using:
  • uglifyjs
  • uglifycss

and both seem to work fine.

Also, it's not really necessary, or even a good idea, to combine all JS files into one big JS minimize file for a number of reasons.

It is not good to "over optimize" and little really great comes of it, in my view.

Most sites like this are changing often and there is always a lot of Javascript code to write, modify, change and debug. Creating "mothers of all minimized Javascript files" make things "a nightmare" and it is better to smartly combine them, and that cannot be done by tool because we need to know that we are developing, where the issues are, what is changing, and what is static.

But anyway, I'm not focused on it and it is not on the site development critical path to worry about minimizing more JS and CSS. I have a lot more important functional code to write for the next month or so.

Cheers and Thanks!
I usually combine and minify them dynamically based on filetime, no issue even if you modify or change code it will work.

- create md5 hash of file to be combined and minified based on filetime.
- check filename with above generated hash exists.
- if exists just readfile otherwise combine and minify them and then serve to client.

One more probably you missed, "Toggle Forum Collapse" button plus symbol not changing when its expanded.

Last edited by Akshay Hegde; 02-19-2019 at 07:46 AM..
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed remove css comments

Is there a way that I can use sed to remove lines with css comments like this? /* comment */ (9 Replies)
Discussion started by: gravesit
9 Replies

2. Web Development

On Css

<html> <head> <style> div.box {width: 300px; height: 200px; padding: 30px; font: 46 pt times new roman;} </style> </head> <body> <div class="box" style=" filter": progid:DXImagetransform.Microsoft.Alpha (Opacity=100, FinishOpacity=0, Style=1, StartX=0, FinishX=0,... (0 Replies)
Discussion started by: N-Training
0 Replies

3. Web Development

HTML down, CSS help, ahhhh

I am having some problems. I have been able to learn HTML, but when I try and encode CSS, nothing happens, what is the major issue here. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MY CSS</title> <style... (7 Replies)
Discussion started by: N-Training
7 Replies

4. Web Development

CSS frameworks

I have been reading up on CSS frameworks, to see if it could be useful for an intranet that I am helping to build, but the true purpose does not become clear to me. What circumstances would the deployment of a CSS framework be useful in? What does a CSS framework do that a CMS template cannot do? (1 Reply)
Discussion started by: figaro
1 Replies
Jifty::Plugin::Chart::Renderer::SimpleBars(3pm) 	User Contributed Perl Documentation	   Jifty::Plugin::Chart::Renderer::SimpleBars(3pm)

NAME
Jifty::Plugin::Chart::Renderer::SimpleBars - a simple horizontal bar chart DESCRIPTION
This is a simple renderer for charts created both as a dead simple way of rendering horizontal bar charts, which can be a very simple way of rendering data, and as a prototype for some other work I'm thinking of doing with the chart plugin. OPTIONS
Of the rendering API, this only uses the first dataset given and ignores any others. It also fails if used for any type other than the only one it supports "horizontalbars". It takes the following options: summary To maximize the accessibility of your chart, set this to describe the data. This will set the table's summary attribute. STYLING
Please be aware that when using this object, you can change the bar color using CSS like so: div.simple_bars span.bar { background-color: black; } METHODS
init Tell Jifty about the CSS and JS files SimpleBars needs. render Renders a horizontal bar chart. This is done by rendering a table of HTML values, which is then converted to a bar chart by the Javascript added to the response during "init". If JavaScript is not supported by the browser, all the data is presented ina table. They can still read the data, but just not in the most readable form. AUTHOR
Andrew Sterling Hanenkamp, "<andrew.hanenkamp@boomer.com>" COPYRIGHT AND LICENSE
Copyright 2007 Boomer Consulting, Inc. This is free software. You may modify and redistribute it under the same terms as Perl itself. perl v5.12.4 2009-03-09 Jifty::Plugin::Chart::Renderer::SimpleBars(3pm)
All times are GMT -4. The time now is 10:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy