1. Compressing CSS template files

Compressing CSS template files

  |   8
Dear friends,

As you know, starting with version 8.5, the script appeared to compress javascript files, which allows up to 70% reduction in their size and thus significantly speed up loading them into your browser. In this article I want to tell you that this feature can be used to file your CSS style template. To do this you must change their connection to the template, let's say your styles are connected in a pattern from the point:

<link rel="stylesheet" type="text/css" href="{THEME}/css/style.css" />
<link rel="stylesheet" type="text/css" href="{THEME}/css/engine.css" />


to enable compression for the files, these lines must be replaced with:
<link rel="stylesheet" type="text/css" href="/engine/classes/min/index.php?f={THEME}/css/style.css,{THEME}/css/engine.css" />
Actually all, now your styles will be automatically combined and compressed, and the browser will be given to already compressed files, saving your traffic significantly. Thus it is necessary to remember only one feature, if you want to change the contents of these files, after making changes, you will need to necessarily go to DLE Admin CP and make clear the cache in the Admin Panel script, as well as make clear the cache in your browser.
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+5

Comments 8

tbenmcp
tbenmcp
DLE TEAM
Commented By tbenmcp on August 30, 2011 (5:17 am)
Thank you for sharing with us...

Here is what you need to know about this method..
1) it use HTTP get package to request css styles files combine using Supercharge javascript to get your style to appear, your server must support http type application/x-httpd-php which most servers that can run dle 9.x are supported this...

2) only support on PHP5 and minimum required PHP 5.1.6 and newer

3) the supercharge javascript using cache on your theme style which means everytime you update your theme styles, you must clear smart cache otherwise it won't show up right the way and dle smart cache is set to default of 36 hours.

4) Minify is designed for efficiency, but, for very high traffic sites, Minify may serve files slower than your HTTPd due to the CGI overhead of PHP.

5) Pages that refer to multiple CSS or javascript files often suffer from slower page loads, due to the browser requesting each file individually. Many browsers also are limited to a few simultaneous requests per domain. The wait for a series of requests and the transfer of unoptimized files can dramatically reduce the client-side performance of your site.

But:
1) Combines and minifies multiple CSS or javascript files into a single download and automatically rewrites relative URIs in combined CSS files to point to valid locations

2) With caching enabled, Minify is capable of handling hundreds of requests per second on a moderately powerful server.

3) Content-Encoding: gzip, based on request headers. Caching allows it so serve gzipped files faster than Apache's mod_deflate option!


so just let you know in case you don't know... fellow
20 150Forum topics : 11Forum replies : 248Forum likes : 32

"A True Friend is Someone Who Sees the Pain in Your Eyes while Everyone Else Believes the Smile on Your Face"
Let me Google for you!
romeoluv56
Commented By romeoluv56 on September 1, 2011 (1:08 pm)
Nice info bro, thanks for your information about the hack
tbenmcp
tbenmcp
DLE TEAM
Commented By tbenmcp on September 2, 2011 (4:58 am)
well I assume that you already know the features of the addon so I just added more info that I have learn and know about it.

Oh by the way this feature was first added to DLE version 8.5 but to be honest with you dle-news people don't even recommend it when they first added because at that time lost of people still using IE6 in combination of IE7 which, well, if you know IE6-7 are terrible and give web designers headache...but at that time Oper 9 and Firefox 2.x are fully support the feature but somehow it wasn't work well on IE, and DLE developers are pretty good on keeping on update the newer version to add in and added more addon with it that included zgip and gzip js..which is pretty good on helping server load balancing and reduce bandwidth...but to be honest with you only a few themes that really only use javascript that come with dle nothing else, but in fact on the other hand we all want to customize our websites and themes to look better and "fantastic" to that can catch people/visitors/users on their websites so they have to add this add that to make it looks good and professional, then if we use our own js javascript other than build-in with dle and enable gzip js file...what happen is your javascript you added to your theme simply won't work not evern popup you added or somehow site analytic not even work...

so my point is, somehow there are lot of options that we don;t even use and some people don't even know it exist that dle team added are useless and take more resource on the server...so I don't know why they even bother to make it and add it...every new release of dle never enough to the users, they always have to find the modules to make the way they want for their sites, i think if dle developer team come out and look around on what the people really want then it would me much better in my opinion...because as far as I know there are very few websites that use DLE and don't need any modules or hacks....would you agree?

Anyway I am just thinking out loud hahaha no
20 150Forum topics : 11Forum replies : 248Forum likes : 32

"A True Friend is Someone Who Sees the Pain in Your Eyes while Everyone Else Believes the Smile on Your Face"
Let me Google for you!
newchap
newchap
V.I.P.
Commented By newchap on April 3, 2012 (8:59 pm)
romeoluv56,
How to use this.. do i have to place the second code in my main.tpl
1 61Forum topics : 6Forum replies : 34Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on April 3, 2012 (10:08 pm)
all you need is use simple tag like this
<link rel="stylesheet" type="text/css" href="/engine/classes/min/index.php?f={THEME}/styles/styles.css,{THEME}/styles/custom.
css,{THEME}/styles/engine.css" />
Just make sure you include all css of your in here...

javascript is not recommended because it cause cause some issues on js or jquery not function correctly
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
newchap
newchap
V.I.P.
Commented By newchap on April 3, 2012 (10:36 pm)
spamhater,
spamhater,
i have to css. mention in main.tpl
<link media="screen" href="{THEME}/style/styles.css" type="text/css" rel="stylesheet" />
<link media="screen" href="{THEME}/style/engine.css" type="text/css" rel="stylesheet" />


so i replace with
<link rel="stylesheet" type="text/css" href="/engine/classes/min/index.php?f={THEME}/style/styles.css,{THEME}/style/engine.cs
s" type="text/css" />


is this correct what
1 61Forum topics : 6Forum replies : 34Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on April 3, 2012 (11:55 pm)
yes, that's correct.
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
newchap
newchap
V.I.P.
Commented By newchap on April 4, 2012 (4:49 am)
spamhater,
This is really working i can see the changes.. dance
1 61Forum topics : 6Forum replies : 34Forum likes : 0
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.