Skip to main content

Content delivery network Concept supporting resource offload

Project description

======
README
======

This buildout recipe package offers 3 different concepts. This 3 concept allows
you to reduce the resources size and offload the resources from your
application server. The nice thing is, that you can start your application with
different configurations if you like to server the minified and static or the
local non monified resource versions. The p01.cdn package also offers a version
manager which allows to use different resource versioning concepts.

Since version 1.0.0 this package is offering versiong per file and doesn't
require to use one version for all resources. The optinal p01.recipe.cdn:setup
recipe creates a script which is able to generate a version map and the related
zrt-replace directives and stores them in a json data map and a less file
which can get included in your related less files.


sprites
-------

The first concept allows to generate sprite images and the relevant css styles
pointing to the right sprite background position. This recipe uses the
spritemapper python package


minify
------

The second concept allows to minify javascript or CSS files. The recipe supports
the following python minify libraries.

jsmin: http://pypi.python.org/pypi/jsmin
lpjsmin: http://pypi.python.org/pypi/lpjsmin
slimit: http://pypi.python.org/pypi/slimit
cssmin: http://pypi.python.org/pypi/cssmin


content delivery network
------------------------

The third concept allows to extract CDN (content delivery network) resources
based on p01.cdn into a folder structure.


=======
CHANGES
=======

1.1.11 (2026-01-02)
-------------------

- Bugfix Python 3 issues with open and encoding. Uses io.open instead and
support encoding


1.1.10 (2025-12-29)
-------------------

- Fixed mutable default arguments bug in extract.py: Changed outNames=[]
to outNames=None with proper initialization in setUpVersions(),
storeResource(), and getSourceOutputPaths().

- Improved code quality: Added context managers (with statements) for all
file operations in extract.py and deploy.py.

- Added explicit UTF-8 encoding to ZCML file writing in app.py.

- Removed unused 'wd' variables in CDNRecipeBase, MinifyRecipe, and
GlueRecipe classes.


1.1.9 (2025-12-29)
------------------

- Fixed Python 3 compatibility in extract.py: Changed ''.join(data) to
b''.join(data) for binary data handling in saveResource().


1.1.8 (2025-12-29)
------------------

- Fixed lpjsmin dependency: addMinifyLibrary now also adds jsmin when
lpjsmin is specified, since lpjsmin requires jsmin to function.


1.1.7 (2025-12-29)
------------------

- fix python 2/3 tests, Improved Jinja2, glue and MarkupSafe egg setup for testing


1.1.6 (2025-12-29)
------------------

- Python 2/3 compatibility: Fixed all print statements in minify.py,
extract.py, deploy.py to use print() function

- Python 2/3 compatibility: Fixed cStringIO import to use io.BytesIO

- Python 2/3 compatibility: Fixed ConfigParser import in sprites.py

- Python 2/3 compatibility: Fixed subprocess output decoding in cmder.py
(bytes to str for Python 3)

- Python 2/3 compatibility: Fixed JSON file reading in extract.py and
minify.py to use proper encoding (json.loads(bytes) fails in Python 3)

- Python 2/3 compatibility: Updated all file operations to use
context managers (with statement) and explicit UTF-8 encoding

- Refactored sprites.py to use external glue package from PyPI instead of
bundled copy. The bundled glue.py can now be removed.

- Added extras_require 'sprites' for glue and Pillow dependencies.
Use p01.recipe.cdn[sprites] to install sprite generation support.

- Simplified GlueRecipe to use p01.recipe.cdn[sprites] instead of
manual PIL/Pillow handling.

- Added Python version classifiers to setup.py


1.1.5 (2025-08-15)
------------------

- bugfix; typo and more PIL version cleanup


1.1.4 (2025-08-15)
------------------

- bugfix; fix broken sprites processing, Skip PIL.VERSION access which is gone.


1.1.3 (2025-07-18)
------------------

- make code python 3 compatible


1.1.2 (2015-09-11)
------------------

- bugfix: fix broken i18n cdn resource path extraction


1.1.1 (2015-09-03)
------------------

- feature: use better error message if a zrt-resource include fails because
of a missing resource (adapter) lookup.


1.1.0 (2015-06-30)
------------------

- feature: check version before write the verisons and zrt-replace directives
the the related files. This prevents that the less compiler get invoked for
nothing because fo the modified zrt-replace.less file.

- bugfix: fix i18n resource extraction


1.0.0 (2015-06-29)
------------------

- feature: support pkg, file include in header option. This allows us to
include files with generated zrt-replace arguments. One usecase for this new
option is the new cdn extraction concept which is able to version each
resource file based on subversion version or the related package version.
This new concept generates a file including all the related zrt-replace.less
rules.

- feature: switch to json config file based minify script processing. This
allows us to use larger headers and source files and isn't limited by
cmd line length.

- feature: added option for extract each resource with it's own version based
on subversion version. See p01.cdn version 1.0.0 for support cdn resources.

- feature: generate zrt-replace.less for extracted resources including all
the related zrt-replace rules. This file can get included as header option
in the p01.recipe.cdn:minify recipe


0.5.7 (2015-03-17)
------------------

- bugfix: support missing parser instance. The parser was missing for show an
error message, e.g. missing directory path


0.5.6 (2014-06-10)
------------------

- extract: print the current layer


0.5.5 (2014-05-08)
------------------

- bugfix: The skip option didn't work. Now you can define optional files by
it's filename and the minify script will only include this skipped files
and not minify the file source.

- bugfix: The libs option didn't work. Now you can define different minify
libraries for each file.


0.5.4 (2013-11-13)
------------------

- Output the resource parameters when extract fails


0.5.3 (2013-03-27)
------------------

- bugfix: use an empty list as default skip option and not None


0.5.2 (2013-03-19)
------------------

- feature: support skip option in extract recipe. This allows to define a list
of filenames thcih get not extracted to the output. This allows to skip the
source files from get deployed to the cdn output folder.

- feature: support slimit mangle, mangle_toplevel and cssmin wrap options. You
can use them as slimit_mangle, slimit_mangle_toplevel and cssmin_wrap in your
buildout.


0.5.1 (2013-01-28)
------------------

- improve error handling, show traceback from executed method


0.5.0 (2012-11-16)
------------------

- initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p01_recipe_cdn-1.1.11.tar.gz (116.9 kB view details)

Uploaded Source

File details

Details for the file p01_recipe_cdn-1.1.11.tar.gz.

File metadata

  • Download URL: p01_recipe_cdn-1.1.11.tar.gz
  • Upload date:
  • Size: 116.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/44.1.1 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for p01_recipe_cdn-1.1.11.tar.gz
Algorithm Hash digest
SHA256 60a2187b677dfc3818f9585d49829f77e5a9de284d4a2176487612ad66bcc840
MD5 8b981d7547ddcfc6c1ac168a30bad55c
BLAKE2b-256 6679f0215ab3d3feed5e760d0f70b58cc9ce41ae360a0aed0af9cbc8b9322352

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page