Skip to content

Commit 98c6ba7

Browse files
committed
Build docs on Travis
Fix references to glossary Clean up
1 parent 1db584f commit 98c6ba7

File tree

7 files changed

+50
-314
lines changed

7 files changed

+50
-314
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ before_script:
1717
- sh -c "if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/install-apache-hhvm.sh; fi"
1818
# Install deps
1919
- composer update --dev --prefer-source
20+
# Install Sphinx
21+
- sudo apt-get install python-sphinx
2022

21-
script: phpunit --coverage-clover=coverage.clover
23+
script:
24+
- phpunit --coverage-clover=coverage.clover
25+
- make -C doc html
2226

2327
after_script:
2428
- wget https://scrutinizer-ci.com/ocular.phar

doc/cache-invalidator.rst

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ Create the cache invalidator by passing a proxy client as
2929
Invalidating Paths and URLs
3030
---------------------------
3131

32-
Make sure to :doc:`configure your proxy <proxy-configuration>` for purging
33-
first.
32+
.. note::
33+
34+
Make sure to :doc:`configure your proxy <proxy-configuration>` for purging
35+
first.
3436

3537
Invalidate a path:
3638

@@ -51,8 +53,10 @@ Invalidate a URL:
5153
Refreshing Paths and URLs
5254
-------------------------
5355

54-
Make sure to :doc:`configure your proxy <proxy-configuration>` for refreshing
55-
first.
56+
.. note::
57+
58+
Make sure to :doc:`configure your proxy <proxy-configuration>` for refreshing
59+
first.
5660

5761
.. code-block:: php
5862
@@ -68,7 +72,10 @@ Refresh a URL:
6872
Invalidating With a Regular Expression
6973
--------------------------------------
7074

71-
Make sure to :doc:`configure your proxy <proxy-configuration>` for banning first.
75+
.. note::
76+
77+
Make sure to :doc:`configure your proxy <proxy-configuration>` for banning
78+
first.
7279

7380
URL, Content Type and Hostname
7481
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -84,7 +91,7 @@ caching proxy:
8491
8592
$cacheInvalidator->invalidateRegex('.*css$')->flush();
8693
87-
To invalidate all .png files for host example.com:
94+
To invalidate all .png files on host example.com:
8895

8996
.. code-block:: php
9097
@@ -96,9 +103,12 @@ To invalidate all .png files for host example.com:
96103
Any Header
97104
~~~~~~~~~~
98105

99-
You can also invalidate the cache based on any headers. If you use non-default
100-
headers, make sure to [configure your proxy accordingly](proxy-configuration.md)
101-
to have them taken into account.
106+
You can also invalidate the cache based on any headers.
107+
108+
.. note::
109+
110+
If you use non-default headers, make sure to :doc:`configure your proxy <proxy-configuration>`
111+
to have them taken into account.
102112

103113
Cache client implementations should fill up the headers to at least have the
104114
default headers always present to simplify the cache configuration rules.
@@ -111,14 +121,17 @@ To invalidate on a custom header ``X-My-Header``, you would do:
111121
112122
.. _tags:
113123

114-
Tags
115-
----
124+
Invalidating Tags
125+
-----------------
126+
127+
.. note::
116128

117-
Make sure to :doc:`configure your proxy <proxy-configuration>` for tagging first.
129+
Make sure to :doc:`configure your proxy <proxy-configuration>` for tagging first.
118130

119-
You will have to make sure your web application adds the correct tags on all
120-
responses by setting the ``X-Cache-Tags`` header. The FOSHttpCacheBundle_ does
121-
does this for you when you’re using Symfony.
131+
With tags you can group related representations so it becomes easier to
132+
invalidate them. You will have to make sure your web application adds the
133+
correct tags on all responses by setting the ``X-Cache-Tags`` header. The
134+
FOSHttpCacheBundle_ does does this for you when you’re using Symfony.
122135

123136
Assume you sent four responses:
124137

doc/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@
3737

3838
# General information about the project.
3939
project = 'FOSHttpCache'
40-
copyright = '2014, David Buchmann, David de Boer'
40+
copyright = '2014, FriendsOfSymfony'
4141

4242
# The version info for the project you're documenting, acts as replacement for
4343
# |version| and |release|, also used in various other places throughout the
4444
# built documents.
4545
#
4646
# The short X.Y version.
47-
version = '1.0'
47+
version = '1.0.0'
4848
# The full version, including alpha/beta/rc tags.
49-
release = '1.0'
49+
release = '1.0.0'
5050

5151
# The language for content autogenerated by Sphinx. Refer to documentation
5252
# for a list of supported languages.
@@ -116,7 +116,7 @@
116116
# Add any paths that contain custom static files (such as style sheets) here,
117117
# relative to this directory. They are copied after the builtin static files,
118118
# so a file named "default.css" will overwrite the builtin "default.css".
119-
html_static_path = ['_static']
119+
# html_static_path = ['_static']
120120

121121
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
122122
# using the given strftime format.

doc/invalidation-introduction.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ An Introduction to Cache Invalidation
22
=====================================
33

44
This general introduction explains cache invalidation concepts. If you are
5-
already familiar with cache invalidation, you may wish to skip this chapter
6-
and continue to the [Cache Invalidator](cache-invalidator.md).
5+
already familiar with cache invalidation, you may wish to skip this chapter.
76

87
HTTP Caching Terminology
98
------------------------
@@ -44,7 +43,7 @@ The problem
4443
HTTP caching is a great solution for improving the performance of your web
4544
application. For lower load on the application and fastest response time, you
4645
want to cache content for a long period. But at the same time, you want your
47-
clients see fresh content as soon as there was an update.
46+
clients to see fresh content as soon as there is an update.
4847

4948
Instead of finding some compromise, you can have both with cache invalidation.
5049
When application data changes, the application takes care of invalidating its
@@ -91,7 +90,7 @@ Cache invalidation has two possible downsides:
9190
changed, a lot more is involved in invalidating all of its representations.
9291
In other words, invalidation adds a layer of complexity to your application.
9392
This library tries to help reduce complexity, for instance by
94-
[tagging](#tags) cached content. Additionally, if you use Symfony2, we
93+
:ref:`tagging <tags>` cached content. Additionally, if you use Symfony2, we
9594
recommend you use the FOSHttpCacheBundle_.
9695
which provides additional functionality to make invalidation easier.
9796
* Invalidation is done through requests to your caching proxy. Sending these

doc/nginx-configuration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ features provided by this library. The examples are tested with Nginx version
88
Purge
99
~~~~~
1010

11-
Nginx does not support :ref:`purge requests <purge>` out of the box. The
11+
Nginx does not support :term:`purge` requests out of the box. The
1212
`ngx_cache_purge <https://github.com/FRiCKLE/ngx_cache_purge>`_ adds some support.
1313

1414
.. note::
@@ -41,7 +41,7 @@ for more on configuring Nginx to support purge requests.
4141
Refresh
4242
~~~~~~~
4343

44-
If you want to invalidate cached objects by :ref:`forcing a refresh <refresh>`
44+
If you want to invalidate cached objects by forcing a :term:`refresh`
4545
you have to use the built-in `proxy_cache_bypass <http://wiki.nginx.org/HttpProxyModule#proxy_cache_bypass/>`_
4646
operation.
4747

doc/testing-your-application.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@ Setting Constants
4343

4444
Compare this library’s configuration to see how the constants are set:
4545

46-
.. code-block:: xml
47-
48-
<?xml version="1.0" encoding="UTF-8"?>
49-
50-
<phpunit ...>
51-
<php>
52-
<const name="VARNISH_FILE" value="./tests/FOS/HttpCache/Tests/Functional/Fixtures/varnish/fos.vcl" />
53-
<const name="WEB_SERVER_HOSTNAME" value="localhost" />
54-
</php>
55-
</phpunit>
46+
.. literalinclude:: ../phpunit.xml.dist
47+
:prepend:
48+
<?xml version="1.0" encoding="UTF-8"?>
49+
<phpunit ...>
50+
:language: xml
51+
:start-after: <php>
5652

5753
Overriding Getters
5854
~~~~~~~~~~~~~~~~~~
@@ -117,7 +113,8 @@ correctly:
117113
118114
public function testCachePurge()
119115
{
120-
// Again, Varnish is restarted, so your test is independent
116+
// Again, Varnish is restarted, so your test is independent from
117+
// other tests
121118
122119
$url = '/blog/articles/1';
123120

0 commit comments

Comments
 (0)