In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

View Revisions: Issue #457 Back to Issue ]
Summary 0000457: Automatic CSS / JS Compression
Revision 2010-04-08 23:57:37 by Dmitry
Description The elegant and simple implementation (doesn't exist yet) of solving problems with large javascript, css files being sent on every page load.

Instead of
<script type="text/javascript"
src="<inp2:m_TemplatesBase/>js/script.js"></script>

we should use

<script type="text/javascript" src="<inp2:m_Script
file="js/script.js"/>"></script>


Tag Script would:

1. get compressed version of given file based on current theme (compressed
versions could be stored under "/system/cache")

2. if given file was changed after compressed file was created, then create
compressed file with file modification time in it's name and return url to
compressed file

3. if given file wasn't changed after compressed file was created, then
return url to compressed file


There would not be any additional calls to index.php to load every
compressed javascript, because of tag implementation is being used. What
ever compression is made or not could be determined by new configuration
variable. Compression could be turned off automatically, when debug mode is
turned on for example. What compressor to use would be determined based on
given file extension. What compressor engine to use will be determined in
later development stages of this feature (command-line, php, java etc.).


NOTE:

We should be able to process multiple JS files (and probably CSS) in a single minimized version.

Let's say I want something like this <script type="text/javascript"
src="<inp2:m_Script file="js/script.js|js/another_jq.js"/>"></script>
I did see it a few times like this - can't remember the software /
website, but will find this and put examples here.
Revision 2010-04-08 23:56:09 by Dmitry
Description The elegant and simple implementation (doesn't exist yet) of solving problems with large javascript, css files being sent on every page load.

Instead of
<script type="text/javascript"
src="<inp2:m_TemplatesBase/>js/script.js"></script>

we should use

<script type="text/javascript" src="<inp2:m_Script
file="js/script.js"/>"></script>


Tag Script would:

1. get compressed version of given file based on current theme (compressed
versions could be stored under "/system/cache")

2. if given file was changed after compressed file was created, then create
compressed file with file modification time in it's name and return url to
compressed file

3. if given file wasn't changed after compressed file was created, then
return url to compressed file


There would not be any additional calls to index.php to load every
compressed javascript, because of tag implementation is being used. What
ever compression is made or not could be determined by new configuration
variable. Compression could be turned off automatically, when debug mode is
turned on for example. What compressor to use would be determined based on
given file extension. What compressor engine to use will be determined in
later development stages of this feature (command-line, php, java etc.).



Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker