-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Gzip caching plugin #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gzip caching plugin #586
Conversation
gzip_static in Nginx looks for a companion compressed file that has a .gz extension. For example, foo.html and foo.html.gz would actually serve foo.html.gz for any requests for foo.html.
This reverts commit 49606f0.
Extending the Writer wasn't the complete answer because the static generator also copies some files. Instead, I implemented the work as a plugin that attaches to the finalized event.
Thanks, that seems a useful plugin for nginx. |
I added a .gitattributes file which should help any cross platform development in the future (and it normalized the files I edited back to a standard Unix format). I didn't notice any unit tests for the plugins which is why I didn't write any. I'll add some soon. |
I'm not convinced that the committed .gitattributes file is the way to go. Folks running Windows can simply configure their machines to perform the needed conversion via:
|
I went with the .gitattributes file because it seems to be what the GitHub Windows client was recommending. If the consensus with this crowd is that the file is not wanted, I'm happy to remove it. |
I would be +1 with the |
Yeah, I've seen that link before, and I'm still not convinced that we need a At the very least, the contents of said file should trimmed down to the bare minimum:
The other lines aren't relevant to Pelican and should be added to local workstations via the |
On 26 November 2012 23:24, Justin Mayer notifications@github.com wrote:
|
As requested, I've reduced the .gitattributes file to just the essential. |
Thanks @mblayman ! |
Awesome! Thanks @bbinet! I'm glad I was able to contribute. |
This is a plugin that will create a gzipped cache file for all the text file types. I wrote this so I could take advantage of gzip_static in Nginx which looks for files with a .gz extension when attempting to serve compressed versions (e.g., foo.html would look for foo.html.gz in the same directory).
This will enable a pelican project to run from a webserver without needing the webserver to do on-the-fly gzip compression (which will help to reduce CPU load).
I'm not sure why the plugin documentation file looks like I completely redid it. All I did was add a section for the "Gzip cache" plugin and added the section to the bulleted list of plugins. Perhaps it's because I edited the file through Cygwin and used the GitHub Windows client. Maybe it's an issue with dos2unix or unix2dos file formatting.