Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
3b79fec6
Commit
3b79fec6
authored
Aug 27, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add signals docs. close #13
parent
bdf4995d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
104 deletions
+44
-104
docs/configuration.rst
+0
-2
docs/farfutureexpires.rst
+0
-101
docs/index.rst
+1
-1
docs/signals.rst
+43
-0
No files found.
docs/configuration.rst
View file @
3b79fec6
...
...
@@ -137,8 +137,6 @@ Other settings
Regulates whether or not to add a "version number" to the outputted files
filename with for use with “far future Expires”.
For more information, see :doc:`farfutureexpires`.
When you specify ``PIPELINE_VERSION`` you will also need to add a placeholder
(which by default is ``?``) for the version number in the ``output_filename`` setting.
...
...
docs/farfutureexpires.rst
deleted
100644 → 0
View file @
bdf4995d
.. _ref-farfutureexpires:
==================
Far future expires
==================
Details about the "Far future expires" technique, and how to implement it with help from Pipeline
General details and considerations about the "Far future expires" technique
===========================================================================
If you really want to make sure that your CSS and JavaScript files get cached by
the browser (and possibly by proxies), you should use "Far Future Expires".
This means that you send the Expires HTTP-header with a date that is far in the future,
resulting in the file being cached at the client (almost) forever
If you do not specify an Expires header, the files will be requested again,
and the server will respond "*304 Not Modified*" - which means that the file that
the client got in its cache is still up-to-date. *However, a HTTP request will still be made anyway.*
The actual data does not get sent, but there will still be unnecessary HTTP requests, which can be avoided.
Most modern browser implement "*Heuristic expiration*", so it will actually not be
"*304 Not Modified*" for your static files on every request, however, the
`HTTP specification does not specify <http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html>`_ (see section 13.2.2)
how "*Heuristic expiration*" should be handled by the browsers.
Therefore it is recommended to explicitly set the Expires header, to make sure all
browsers cache the files in the preferred way.
This technique obviously has a drawback, when you want to change your files,
you need to change their names, since their URLs will be cached... that's right: forever!
The solution to that is pretty obvious too: change the URLs.
Versionning
===========
If you specify ``PIPELINE_VERSION`` in your configuration, you can add a placeholder
to the filenames to output the version number of the different files.
The filename itself will be changed when any of the source files are updated.
See :doc:`configuration` for more information.
Configuration of web server
===========================
Apache
------
Expires-control in Apache is handled by mod_expires:
See documentation for more information:
* `mod_expires <http://httpd.apache.org/docs/2.2/mod/mod_expires.html>`_
For example ::
<Directory /your/media/root/css>
ExpiresActive on
ExpiresDefault "access plus 10 years"
</Directory>
Apache also allows the specify files by their mime-type ::
ExpiresActive On
ExpiresByType text/css "access plus 10 years"
ExpiresByType application/x-javascript "access plus 10 years"
lighttpd
--------
lighttpd handles Expires similar to Apache, with a module called mod_expire.
* `mod_expire <http://trac.lighttpd.net/trac/wiki/Docs%3AModExpire>`_
For example, set far future headers on all files under ``/media/css/`` and ``/media/js/`` ::
$HTTP["url"] =~ "^/media/css/" {
expire.url = ( "" => "access 10 years" )
}
$HTTP["url"] =~ "^/media/js/" {
expire.url = ( "" => "access 10 years" )
}
nginx
-----
nginx's ``ngx_http_headers_module`` provides the ``expires`` option, which control
the ``Expires`` and ``Cache-Control`` HTTP headers.
* `ngx_http_headers_module <http://wiki.codemongers.com/NginxHttpHeadersModule>`_
For example, this will set expiration to the maximum expiration ::
location /media/js {
expires max;
}
location /media/css {
expires max;
}
docs/index.rst
View file @
3b79fec6
...
...
@@ -21,7 +21,7 @@ Table Of Contents
versioning
templates
storages
farfutureexpire
s
signal
s
changelog
Indices and tables
...
...
docs/signals.rst
0 → 100644
View file @
3b79fec6
.. _ref-signals:
=======
Signals
=======
A list of all signals send by pipeline.
css_compressed
--------------
pipeline.signals.css_compressed
Whenever a css package is compressed, this signal is sent after the compression.
Arguments sent with this signal :
:sender:
The ``Packager`` class that compressed the group.
:package:
The package actually compressed.
:version:
The version identifier if the newly compressed file.
js_compressed
--------------
pipeline.signals.js_compressed
Whenever a js package is compressed, this signal is sent after the compression.
Arguments sent with this signal :
:sender:
The ``Packager`` class that compressed the group.
:package:
The package actually compressed.
:version:
The version identifier if the newly compressed file.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment