{
"info": {
"author": "Manuel Barkhau",
"author_email": "mbarkhau@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Utilities"
],
"description": "## Omnibust - A universal cachebusting script\n\nA language and framework agnostic cachbusting script.\n\nOmnibust will scan the files of your web project for static resources\n(js, css, png) and also for urls in your source code (html, js, css, py,\nrb, etc.) which reference these resources. It will add or update a\ncachebust parameter on any such urls based on the static resources they\nreference.\n\nRequires python >= 2.6 or python >= 3.2.\n[](https://travis-ci.org/mbarkhau/omnibust)\n\n\n### Installation\n\n $ pip install omnibust\n\nOr\n\n $ wget https://raw.github.com/mbarkhau/omnibust/master/omnibust.py\n $ chmod +x omnibust.py\n $ cp omnibust.py /usr/local/bin/omnibust\n\n\nCheck that it worked\n \n $ omnibust --help\n\n\n### Usage\n\nProject setup:\n\n $ cd your/project/directory\n $ omninust init\n\nThis will write the `.omnibust` file, which you can take a look at and\nupdate if some of your urls are not being found or scanning your project\nfiles is taking too long.\n\nIf this doesn't find all references to static files, or doesn't find\nthe static files themselves, you will have to adjust `static_dirs` and\n`code_dirs` in your `.omnibust` file (see below). Please also consider\nopening a ticket on [https://bitbucket.org/mbarkhau/omnibust], as \nomnibust should work out of the box for as many projects as reasonably\npossible.\n\nThe `rewrite` option will add a `_cb_` to every static url it can\nfind and associate with a static file in the project directory.\n\nCAUTION: Since `rewrite` will modify your source files, you should\ncommit or backup your files and run `omnibust status` first to make\ncertain it won't modify anything it shouldn't.\n\n $ omnibust status --querystring\n $ omnibust rewrite --querystring\n\nFrom now on you simply run omnibust rewrite on your project directory\nand it will only update urls with an existing `_cb_` parameter.\n\n $ omnibust rewrite\n\n\n### Options and Configuration\n\n\nExplicitly specify files\nTODO: parameter configuration\n\n\n### Dynamic URLs and Multibust\n\nSome URLs may not be found with `omnibust init`, esp. if they are not preceded\nby something like `src=` or `url(`, and of course URLs which are dynamically\ncreated during runtime cannot automatically be found at all.\n\nYou can help omnibust find these by manually marking them with `_cb_`. After\nthis, you can run `omnibust update` will expand the marker to a full cachbust\nparameter.\n\nThe `multibust` configuration option allows for a limited form of dynamic URLs.\nOmnibust will expand any URL using the configured `multibust` mapping. If a\nmultibust key (typically a template variable) is found in an URL, it is \nexpanded using the corresponding associated multibust values. The search for\nstatic resources is then based on the expanded URLs.\n\nGiven the configuration\n\n \"multibust\": {\"{{ language }}\": [\"en\", \"de\", \"fr\", \"jp\", \"es\"]}\n\nAnd the following URL\n\n
\n\nThe following static resources may be matched for this URL\n\n /static/i18n_image_en.png\n /static/i18n_image_de.png\n ...\n\nIf any of these files is modified, the cachebust parameter will be updated. \nThis method is safe (in that any change to the static resource results in\ncache invalidation) and convenient (in that one url can be used to reference\nsemantically similar files), but it does mean that some cached files will be\ninvalidated that were still valid. If this is a problem for you, all static\nfiles will have to be referenced explicitly. You could for example create a\nmapping of the form\n\n i18n_images = {\n 'en': \"/static/i18n_image_en_cb_0123abcd.png\",\n 'de': \"/static/i18n_image_de_cb_0123abcd.png\",\n ...\n }\n\nAnd reference it for example from a jinja2 template like this\n\n
\n\n\n### Webserver Setup\n\nIn order for browsers to cache and reuse your static resources, your\nwebserver must set appropriate cache headers. Here are some example\nconfiguration directives for common webservers.\n\n\n### Filename Based Cachbusting\n\nOmnibust defaults to query parameter `app.js?_cb_=0123abcd` based\ncachbusting, but it can also rewrite the filenames in urls to the form\n`app_cb_0123abcd.js`. This is useful since URLs with query parameters are not\ncached by all browsers in all situations, even if all caching headers are\nprovided correctly [needs reference]. TODO: check if there are browsers where\na cached resource will be used even if the query string changes.\n\nPutting a cachebust parameter in the filename of a URL will guarantee that your\nstatic resource is loaded when it has changed and it will be cached in more\nsituations. The downside is, that your urls now have filenames which reference\nfiles that don't actually exist! (Assuming you don't create them, which would\nbe quite laborious and error prone.) The sollution is to have your webserver\nrewrite the urls of requests it recieves, by stripping out the cachebust\nparameter, and serving the correct static resource. Here are some\nconfiguration directives for common webservers.\n\n\t# Nginx\n\n\tlocation ~* ^/static/(.+?)_cb_\\w+(\\.\\w+)$ {\n\t alias /srv/www/static/$1$2;\n\t add_header Vary Accept-Encoding;\n\t expires max;\n\t}\n \n\t# Apache\n\n\tRewriteRule ^/static/(.+?)_cb_\\w+(\\.\\w+)$ /static/$1$2\n\nCopyright (c) 2012-2013 Manuel Barkhau, \nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nCONSEQUENTIAL DAMAGES LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.",
"description_content_type": null,
"docs_url": null,
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://bitbucket.org/mbarkhau/omnibust/",
"keywords": "cachebust web",
"license": "BSD License",
"maintainer": null,
"maintainer_email": null,
"name": "omnibust",
"package_url": "https://pypi.org/project/omnibust/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/omnibust/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://bitbucket.org/mbarkhau/omnibust/"
},
"release_url": "https://pypi.org/project/omnibust/0.1.2/",
"requires_dist": null,
"requires_python": null,
"summary": "Cachebusting Script that works everywhere",
"version": "0.1.2"
},
"last_serial": 939344,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "327946f1ea18639739218396e9181dd2",
"sha256": "c12e94f99b401557a2d3a6f2d26ec38a6816c0e1eebc8df2d7b69befb52d968c"
},
"downloads": -1,
"filename": "omnibust-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "327946f1ea18639739218396e9181dd2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12469,
"upload_time": "2013-09-15T21:57:29",
"url": "https://files.pythonhosted.org/packages/b7/4e/aaaba76db7b10b0711a9d3805235c083c98544305e968b78eb461ca8cc17/omnibust-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "b395fa3c4d434d31dd1ff6a51d24a018",
"sha256": "5c90443b07b4efb816511487c65d531e797ba9845f93badd815466dd42e88fa4"
},
"downloads": -1,
"filename": "omnibust-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "b395fa3c4d434d31dd1ff6a51d24a018",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14801,
"upload_time": "2013-09-15T22:08:50",
"url": "https://files.pythonhosted.org/packages/43/18/45e0061585bd2fa373d6a3d8d1edf693eb24df8b2e890146f551eafcc94d/omnibust-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "1c6c000143e2e198bac79892c02c176a",
"sha256": "17841b1e6e9e9e847cbee7a956078787ad9f82d90fc0a9d984bf694532cbc51a"
},
"downloads": -1,
"filename": "omnibust-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "1c6c000143e2e198bac79892c02c176a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14886,
"upload_time": "2013-12-08T22:31:12",
"url": "https://files.pythonhosted.org/packages/a3/53/0089b21d139e48497838f67d4395732c996911bbc1d65859dcffc38844a4/omnibust-0.1.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "1c6c000143e2e198bac79892c02c176a",
"sha256": "17841b1e6e9e9e847cbee7a956078787ad9f82d90fc0a9d984bf694532cbc51a"
},
"downloads": -1,
"filename": "omnibust-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "1c6c000143e2e198bac79892c02c176a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14886,
"upload_time": "2013-12-08T22:31:12",
"url": "https://files.pythonhosted.org/packages/a3/53/0089b21d139e48497838f67d4395732c996911bbc1d65859dcffc38844a4/omnibust-0.1.2.tar.gz"
}
]
}