Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscovg committed Dec 28, 2015
1 parent 3eebc1f commit 2eb356d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion material/webdev/esi-user.php
Expand Up @@ -6,7 +6,7 @@
$now = $date->format( DateTime::RFC2822 );
?>
<p>This is content on the user-specific ESI-include. This part of
the page is can be cached in Varnish separately since it emits
the page is cached in Varnish separately since it emits
a "Vary: Cookie"-header. We can not affect the client-cache of
this sub-page, since that is determined by the cache-control
headers on the top-element.</p>
Expand Down
12 changes: 9 additions & 3 deletions varnish_book.rst
Expand Up @@ -448,6 +448,7 @@ Varnish Cache and Varnish Software Timeline
Poul-Henning Kamp did the majority of the actual development.
- 2006: Varnish 1.0 released.
- 2008: Varnish 2.0 released.
- 2008: ``varnishtest`` is introduced.
- 2009: The first Varnish User Group Meeting is held in London.
Roughly a dozen people participate from all around the world.
- 2010: Varnish Software is born as a spin-off to Redpill Linpro AS.
Expand Down Expand Up @@ -1092,6 +1093,9 @@ Running Your Varnish Tests
There is much more to explain about ``varnishtest``, but before that, you must learn more about the fundamentals of Varnish.
We will introduce new concepts and make a more advanced use of ``varnishtest`` as we progress in the book.

.. bookmark
.. TODO for the author: Add vtctrans
Configure Varnish
-----------------

Expand Down Expand Up @@ -5883,7 +5887,7 @@ Best Practices for Cookies
unset beresp.http.Set-cookie;
}

Exercise: Compare ``Vary`` and ``hash_data`` in ``varnishtest``
Exercise: Handle Cookies with ``Vary`` and ``hash_data()`` in ``varnishtest``
...............................................................

In this exercise you have to use two cache techniques; first ``Vary`` and then ``hash_data``.
Expand Down Expand Up @@ -5962,8 +5966,8 @@ Solution: Handle Cookies with ``hash_data()`` in ``varnishtest``

txreq -req PURGE -url "/cookie.php" -hdr "Cookie: user: Alice"

Exercise: Compare ``Vary`` and ``hash_data`` with HTTPie
........................................................
Exercise: Handle Cookies with ``Vary`` and ``hash_data`` with HTTPie
....................................................................

In this exercise you have to use two cache techniques; first ``Vary`` and then ``hash_data()``.
The exercise uses the ``Cookie`` header field, but the same rules apply to any other field.
Expand Down Expand Up @@ -6145,6 +6149,8 @@ Exercise: Enable ESI and Cookies

.. container:: handout

See `Exercise: Handle Cookies Vary and hash_data() in varnishtest`_

Try to avoid ``return (hash);`` in `vcl_recv` and ``return (deliver);`` in ``vcl_backend_response`` as much as you can.
This is a general rule to make safer Varnish setups.

Expand Down

0 comments on commit 2eb356d

Please sign in to comment.