Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Imported From: http://groups.google.com/group/in-portal-dev/browse_thread/thread/d81f3bf4d0f0bd38#

Together with Sergey G. we came across very 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

Before
Code Block
languagexml
<script type="text/javascript"

...

 src="<inp2:m_TemplatesBase/>js/script.js"></script>

...

After
Code Block
languagexml
<script type="text/javascript" src="<inp2:m_Script

...

 file="js/script.js"/>"></script>

...

Tag Script would:  1.

  1. get compressed version of given file based on current theme (compressed

...

  1. versions could be stored under "/system/cache")

...

  1. if given file was changed after compressed file was created, then create

...

  1. compressed file with file modification time in it's name and return url to

...

  1. compressed file

...

  1. if given file wasn't changed after compressed file was created, then

...

  1. 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.).

Any suggestions would be appreciated.

--
Best Regards,

http://www.in-portal.org
http://www.alex-time.com

Related Tasks

Jira Legacy
serverSystem Jira
serverId513b375f-8291-3313-9d9f-704c39b1f915
keyINP-382