Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

The packer

What ezjscore's packer does with your stylesheets and scripts: merging, minifying, rewriting url() paths, naming the packed file after its sources and their time, where the file is stored, and the settings that control…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/theme-design/the-packer.md

On this page

The packer

This page is for designers who want to understand what happens to their CSS and JavaScript between the design folder and the browser. The packer is part of the ezjscore extension (extension/ezjscore/classes/ezjscpacker.php).

Warning

.htaccess slows down every request. When .htaccess files are enabled (AllowOverride anything but None), let alone used, Apache looks for them and reads and evaluates them on every request, in every directory of the path, and page loading times go up drastically (measured). The only real fix is to switch the feature off for the virtual host: AllowOverride None in the HTTPS virtual host, and the rules in the virtual host's own configuration as mod_rewrite rules. That is far faster in production speed tests and well worth the time it takes to optimize a production configuration. Switch over right away: copy the rules of the example HTTPS virtual host into your virtual host (with the static cache, also staticcache_offload.conf), set AllowOverride None, run apachectl configtest, reload Apache and test the site. The same rules for other servers: nginx, LiteSpeed, Caddy, IIS, Velocity (built in); where virtual host rules go in a control panel: Plesk, cPanel, DirectAdmin, ISPConfig. On LiteSpeed or OpenLiteSpeed, the server's own page cache can also answer anonymous visitors and crawlers without PHP: Page caching with LiteSpeed and OpenLiteSpeed.

Contents

  1. What it does
  2. Where packed files live
  3. How a packed file is named
  4. Settings
  5. Developing with the packer off
  6. Troubleshooting

What it does

For each ezcss_load, ezscript_load (and the other packer operators) call, the packer:

  1. finds every file through the design cascade;
  2. at pack level 1 or more, concatenates them into one file, in the order given;
  3. at level 2, runs the optimizers of ezjscore.ini [eZJSCore] (JavaScriptOptimizer[]=ezjscJavascriptOptimizer, CssOptimizer[]=ezjscCssOptimizer), which remove comments and whitespace;
  4. for CSS, rewrites relative url() paths into absolute ones, so images and fonts referenced by your stylesheet still load from the packed location;
  5. writes the result once and prints a single <link> or <script> tag pointing to it.

Fewer files mean fewer requests: the media design's pagelayout/head/style.tpl names fifteen stylesheets in one ezcss_load call, and the browser fetches one file.

Where packed files live

In the public cache of the site: var/<site>/cache/public/stylesheets/ and .../javascript/. The shipped rewrite rules serve var/<site>/cache/public/ directly (.htaccess_root), so packed files never go through PHP once written.

How a packed file is named

With ezjscore.ini [Packer] AppendLastModifiedTime=enabled (the default in this release) a packed file is named

<md5 of the source file list and pack level>_<newest modification time of the sources>_<media>.css

for example 82b3f6472765825fde39b69dc69ebd0a_1792109816_all.css. Consequences:

  • Change a source file and its time changes, so the packed file gets a new name and browsers fetch it; no manual version query is needed (No version queries on asset links).
  • Packed files can be cached by browsers for a long time.
  • Old packed files stay on disk until the ezjscore-packer cache is cleared.

Settings

SettingDefaultEffect
site.ini [TemplateSettings] DevelopmentModedisabledenabled forces pack level 0 (every file on its own), unless ezjscore.ini [eZJSCore] Packer is set
ezjscore.ini [eZJSCore] Packernot setdisabled = level 0 always; a number 0 to 3 = that level always; enabled = the level of each call even in development mode
ezjscore.ini [Packer] AppendLastModifiedTimeenabledthe time in the file name, as above
ezjscore.ini [Packer] CustomHosts[]emptyserve packed .js or .css from another host, e.g. CustomHosts[.js]=https://static.example.com
ezjscore.ini [eZJSCore] LoadFromCDNdisabledezjsc::jquery from the local copy (enabled: from the CDN URLs of ExternalScripts[])

Change them in your design extension's or siteaccess's ezjscore.ini.append.php, never in extension/ezjscore/settings/.

Developing with the packer off

On a development or preview siteaccess:

# settings/siteaccess/<preview>/site.ini.append.php
[TemplateSettings]
DevelopmentMode=enabled

Each stylesheet is then linked on its own, under its own name, so the browser's style inspector shows which file and line a rule comes from. Never enable DevelopmentMode on a live site: it also makes the template engine check file times on every request.

Troubleshooting

SymptomCause and fix
A file is missing from the packed CSSnot found in the cascade: the debug output has "Could not find: ..."; check the path relative to stylesheets/
Images in CSS broken after packingan absolute url(/...) that points to the wrong place; use paths relative to the stylesheet
Admin without styles after a cache clearthe admin's head names packed files inside a template-block; clear ezjscore-packer and template-block together (exp:velocity deploy --packer)
One script error breaks every scriptin a packed bundle all files share one file; fix the error or split the bundle

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x