Skip to content

Remove inline C from bundle docs (moved to library) #240

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions Resources/doc/reference/configuration/headers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,21 +332,6 @@ then use on the reverse proxy:

This example adds the header ``X-Reverse-Proxy-TTL: 3600`` to your responses.
Varnish by default knows nothing about this header. To make this solution work,
you need to extend your varnish ``vcl_fetch`` configuration:

.. code-block:: c

sub vcl_fetch {
if (beresp.http.X-Reverse-Proxy-TTL) {
C{
char *ttl;
ttl = VRT_GetHdr(sp, HDR_BERESP, "\024X-Reverse-Proxy-TTL:");
VRT_l_beresp_ttl(sp, atoi(ttl));
}C
unset beresp.http.X-Reverse-Proxy-TTL;
}
}

Note that there is a ``beresp.ttl`` field in VCL but unfortunately it can only
be set to absolute values and not dynamically. Thus we have to revert to a C
code fragment.
you need to extend your varnish ``vcl_fetch`` configuration. Please refer to
the :ref:`FOSHttpCache library’s docs <foshttpcache:varnish_customttl>`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

travis complains that the link has a syntax error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that’s because the varnish_customttl reference wasn’t added to the lib docs until recently, and we point the bundle docs to the lib’s stable branch. Should we wait with merging this PR until we have a stable 2.0 lib, or should we already start preparing the bundle for a 2.0 and change the doc URL to point to the lib’s unstable 2.0?

Copy link
Contributor

@dbu dbu Sep 30, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, we have not started 2.0 of the bundle. lets do that now i would say, and start the 1.3 branch for fixes until 2.0 can be released.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but we decided to not have separate unstable branches. So let’s link both master branches together and have the bundle master’s docs point to the lib’s master ones?

On 30 Sep 2015, at 09:22, David Buchmann [email protected] wrote:

In Resources/doc/reference/configuration/headers.rst #240 (comment):

  • sub vcl_fetch {
  •    if (beresp.http.X-Reverse-Proxy-TTL) {
    
  •        C{
    
  •            char *ttl;
    
  •            ttl = VRT_GetHdr(sp, HDR_BERESP, "\024X-Reverse-Proxy-TTL:");
    
  •            VRT_l_beresp_ttl(sp, atoi(ttl));
    
  •        }C
    
  •        unset beresp.http.X-Reverse-Proxy-TTL;
    
  •    }
    

- }

-Note that there is a beresp.ttl field in VCL but unfortunately it can only
-be set to absolute values and not dynamically. Thus we have to revert to a C
-code fragment.
+you need to extend your varnish vcl_fetch configuration. Please refer to
+the :ref:FOSHttpCache library’s docs <foshttpcache:varnish_customttl>
the unstable doc of the bundle (aka 2.0) should link with the unstable doc of the library i would say. otherwise as we update, more and more things will get out of sync.

Reply to this email directly or view it on GitHub https://github.com/FriendsOfSymfony/FOSHttpCacheBundle/pull/240/files#r40764858.

Copy link
Contributor

@dbu dbu Sep 30, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for more information.