Re: [squid-users] store_id_extras to access request header
If you want, please support this topic in the bug-report http://lists.squid-cache.org/pipermail/squid-users/2018-July/018743.html ___ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users
Re: [squid-users] store_id_extras to access request header
On Wed, Jul 11, 2018 at 8:37 PM Alex Rousskov < rouss...@measurement-factory.com> wrote: > On 07/10/2018 11:59 PM, Kedar K wrote: > > > I tried to get the request header to store id helper > > with %>h option for store_id_extras; However, I get a '-' > > > store_id_extras "%>h %>a/%>A %un %>rm myip=%la myport=%lp" > > > Is this expected behaviour? > > No, it is not expected. Consider filing a bug report with Squid bugzilla > and, if possible, attach an ALL,9 cache.log while reproducing the > problem with a single wget or curl transaction. Please do not forget to > specify your Squid version. > > If you can reproduce the problem with Squid v4 or v5, please mention > that as well. Thank you Alex; yes it seems a bug; tested with both store_id & url_rewrite extras. Either of them send blank headers. BTW I am using version 3.5.20 I will test with ALL,9 and report the bug. > > > > Wouldn't request header be available before > > sending a query to store-id helper? > > Yes, request headers are available at Store ID calculation time. > > > > Is it possible to use combination of store_id_program helper and > > rewrite_url_program; such that the extra params from the url are used by > > store-id helper to create a store-id and then the url_rewrite program > > can strip them off before sending the request to origin server? > > That plan would not work because the Store ID helper is consulted after > the URL rewriter: > https://wiki.squid-cache.org/SquidFaq/OrderIsImportant#Callout_Sequence > > this makes it clear now > > Using custom headers is a much simpler/cleaner solution IMO. > > Agree > > HTH, > > Alex. > -- - Kedar ___ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users
Re: [squid-users] store_id_extras to access request header
On 07/10/2018 11:59 PM, Kedar K wrote: > I tried to get the request header to store id helper > with %>h option for store_id_extras; However, I get a '-' > store_id_extras "%>h %>a/%>A %un %>rm myip=%la myport=%lp" > Is this expected behaviour? No, it is not expected. Consider filing a bug report with Squid bugzilla and, if possible, attach an ALL,9 cache.log while reproducing the problem with a single wget or curl transaction. Please do not forget to specify your Squid version. If you can reproduce the problem with Squid v4 or v5, please mention that as well. > Wouldn't request header be available before > sending a query to store-id helper? Yes, request headers are available at Store ID calculation time. > Is it possible to use combination of store_id_program helper and > rewrite_url_program; such that the extra params from the url are used by > store-id helper to create a store-id and then the url_rewrite program > can strip them off before sending the request to origin server? That plan would not work because the Store ID helper is consulted after the URL rewriter: https://wiki.squid-cache.org/SquidFaq/OrderIsImportant#Callout_Sequence Using custom headers is a much simpler/cleaner solution IMO. HTH, Alex. ___ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users
Re: [squid-users] store_id_extras to access request header
With following config to access request header; store_id_extras "%>h %>a/%>A %un %>rm myip=%la myport=%lp" the store_id_extras does not seem to forward header info. Is there something that I might be missing? Again, I see the header in access.log; However the same is missing from the data send to store-id helper. On Wed, Jul 11, 2018 at 3:29 PM Kedar K wrote: > That was a false alarm; it actually cached only the redirected url and the > key generated by store-id helper was not used. > > On Wed, Jul 11, 2018 at 2:49 PM Kedar K wrote: > >> It worked with a combination of store-id helper and url rewriter. >> >> - Kedar >> >> On Wed, Jul 11, 2018 at 11:42 AM Kedar K wrote: >> >>> additional note: >>> I do see both request and response header in access.log though. >>> >>> On Wed, Jul 11, 2018 at 11:29 AM Kedar K >>> wrote: >>> Hi, I tried to get the request header to store id helper with %>h option for store_id_extras; However, I get a '-' (and the default k-v pairs intact) Is this expected behaviour? Wouldn't request header be available before sending a query to store-id helper? My use case was to pass custom fields either as part of URL (append at the end) or request header. Is it possible to use combination of store_id_program helper and rewrite_url_program; such that the extra params from the url are used by store-id helper to create a store-id and then the url_rewrite program can strip them off before sending the request to origin server? -- *- Kedar* >>> >>> >>> -- >>> >>> >>> >> >> -- >> >> >> ___ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users
Re: [squid-users] store_id_extras to access request header
That was a false alarm; it actually cached only the redirected url and the key generated by store-id helper was not used. On Wed, Jul 11, 2018 at 2:49 PM Kedar K wrote: > It worked with a combination of store-id helper and url rewriter. > > - Kedar > > On Wed, Jul 11, 2018 at 11:42 AM Kedar K wrote: > >> additional note: >> I do see both request and response header in access.log though. >> >> On Wed, Jul 11, 2018 at 11:29 AM Kedar K wrote: >> >>> Hi, >>> I tried to get the request header to store id helper >>> with %>h option for store_id_extras; However, I get a '-' (and the >>> default k-v pairs intact) >>> >>> Is this expected behaviour? Wouldn't request header be available before >>> sending a query to store-id helper? >>> >>> My use case was to pass custom fields either as part of URL (append at >>> the end) or request header. >>> >>> Is it possible to use combination of store_id_program helper and >>> rewrite_url_program; such that the extra params from the url are used by >>> store-id helper to create a store-id and then the url_rewrite program can >>> strip them off before sending the request to origin server? >>> >>> >>> -- >>> >>> *- Kedar* >>> >> >> >> -- >> >> *- Kedar Kekan* >> > > > -- > > *- Kedar Kekan* > -- *- Kedar Kekan* ___ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users
Re: [squid-users] store_id_extras to access request header
It worked with a combination of store-id helper and url rewriter. - Kedar On Wed, Jul 11, 2018 at 11:42 AM Kedar K wrote: > additional note: > I do see both request and response header in access.log though. > > On Wed, Jul 11, 2018 at 11:29 AM Kedar K wrote: > >> Hi, >> I tried to get the request header to store id helper >> with %>h option for store_id_extras; However, I get a '-' (and the >> default k-v pairs intact) >> >> Is this expected behaviour? Wouldn't request header be available before >> sending a query to store-id helper? >> >> My use case was to pass custom fields either as part of URL (append at >> the end) or request header. >> >> Is it possible to use combination of store_id_program helper and >> rewrite_url_program; such that the extra params from the url are used by >> store-id helper to create a store-id and then the url_rewrite program can >> strip them off before sending the request to origin server? >> >> >> -- >> >> *- Kedar* >> > > > -- > > *- Kedar Kekan* > -- *- Kedar Kekan* ___ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users
Re: [squid-users] store_id_extras to access request header
additional note: I do see both request and response header in access.log though. On Wed, Jul 11, 2018 at 11:29 AM Kedar K wrote: > Hi, > I tried to get the request header to store id helper > with %>h option for store_id_extras; However, I get a '-' (and the default > k-v pairs intact) > > Is this expected behaviour? Wouldn't request header be available before > sending a query to store-id helper? > > My use case was to pass custom fields either as part of URL (append at > the end) or request header. > > Is it possible to use combination of store_id_program helper and > rewrite_url_program; such that the extra params from the url are used by > store-id helper to create a store-id and then the url_rewrite program can > strip them off before sending the request to origin server? > > > -- > > *- Kedar* > -- *- Kedar Kekan* ___ squid-users mailing list squid-users@lists.squid-cache.org http://lists.squid-cache.org/listinfo/squid-users