getnikola / nikola

A static website and blog generator
https://getnikola.com/
MIT License
2.62k stars 449 forks source link

Make GZIP deterministic #3650

Closed JesperDramsch closed 1 year ago

JesperDramsch commented 1 year ago

Requested Feature: (short description) Change GZIP command to create deterministic compressed files, so that automatic deployments can diff the files.

Related Area: (eg. tasks, compilers, configuration, templates…) GZIP task

Do you want to contribute this yourself as a pull request? (don’t worry about it if you don’t want to/can’t — someone else can take care of it)

Does this feature affect backwards compatibility? If yes, in what way? Probably not, just in the way that gzip files wouldn't contain the compression time anymore.

Rationale and full description: (why should it be added to Nikola?) It's a minimal change without downside to most users.

The GZIP compression files can be easily diffed by any method after this change and therefore automatic deployment via nikola-action can be sped up significantly, due to files not accidentally showing up as changed / updated.

The change is just adding mtime=0 to the Gzipfile() call here:

/nikola/plugins/task/gzip.py

Kwpolska commented 1 year ago

Can you prepare a pull request for this and #3649?

JesperDramsch commented 1 year ago

Yup!