https://github.com/rhpvorderman/gzip_static
Compress your static website with gzip for faster serving with NGiNX's gzip_static on.
https://github.com/rhpvorderman/gzip_static
checksum compression gzip idempotent precompress static static-site zopfli
Last synced: 3 months ago
JSON representation
Compress your static website with gzip for faster serving with NGiNX's gzip_static on.
- Host: GitHub
- URL: https://github.com/rhpvorderman/gzip_static
- Owner: rhpvorderman
- License: gpl-3.0
- Created: 2021-10-21T05:54:40.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2021-11-04T11:00:05.000Z (over 3 years ago)
- Last Synced: 2025-02-18T00:29:21.981Z (3 months ago)
- Topics: checksum, compression, gzip, idempotent, precompress, static, static-site, zopfli
- Language: Python
- Homepage:
- Size: 413 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://img.shields.io/pypi/v/gzip_static.svg
:target: https://pypi.org/project/gzip_static/
:alt:.. image:: https://img.shields.io/pypi/pyversions/gzip_static.svg
:target: https://pypi.org/project/gzip_static/
:alt:.. image:: https://img.shields.io/pypi/l/gzip_static.svg
:target: https://github.com/LUMC/isal/blob/main/LICENSE
:alt:.. image:: https://codecov.io/gh/rhpvorderman/gzip_static/branch/main/graph/badge.svg?token=NFFZIBF1ZA
:target: https://codecov.io/gh/rhpvorderman/gzip_static.. image:: https://readthedocs.org/projects/gzip_static/badge
:target: https://gzip_static.readthedocs.io
:alt:gzip_static
===========Compress your static website or website's static assets with gzip for faster
serving with `nginx `_'s `gzip_static
`_ module.Nginx does not perform checks on the served gzip to determine if it is out of
date. This program was created to automate the checks and compression of the
static files at the website's build time.Features
--------+ Finds all static files in a directory and its subdirectories automatically
based on an `extensions file `_ which can be
customized.
+ `Idempotent `_. Only compresses
files that have not been compressed yet or are changed. Can therefore be used with
configuration management systems such as `Ansible `_.
+ Guards against serving outdated gzips+ Gzip content is checked with a checksum to verify that a file has changed.
+ Has a ``--remove-orphans`` option to remove gzips for which the source
static file is no longer available.+ The created gzip files inherited filesystem attributes from the source static
files such as the mode and the last modified time.
+ Works on any machine with Python 3.6 or higher installed. It does not depend
on other packages for its core functionally.
+ Zopfli compression is supported when `zopfli `_
is installed.
+ Can be used as a library in other projects and has a `fully documented API
`_.
+ Optimized for checksumming small gzip file contents. Rerunning gzip_static on
an already compressed website is very quick.Quickstart
----------Install gzip_static with ``pip install gzip_static`` or ``pip install --user
gzip_static``. For more installation options and options to enable more
functionally such as zopfli and better speed, checkout `the installation
documentation `_.+ To compress all static files in a directory:
``gzip-static /var/www/my_example_website/``
+ To check if all gzip files are up to date and recompress gzip files for which
the source has changed:
``gzip-static /var/www/my_example_website/`` (Same command due to idempotency)
+ To check if all gzip files are up to date, recompress changed ones and remove
gzip files for which a source static file is no longer present:
``gzip-static --remove-orphans /var/www/my_example_website/``
+ To check for orphaned files only: ``gzip-static-find-orphans /var/www/my_example_website/``For a more extended usage and more options use ``gzip-static --help`` or
checkout `the usage documentation
`_.Contributing
------------
For bug reports and feature requests please use the `github issue tracker
`_. Pull requests
are also welcome.Please note that brotli support is currently not in this project's scope.
This may change. For more information read
`here `_.