Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

User-defined variables: why not?

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


savetheinterpod at gmail

Mar 23, 2012, 12:01 AM

Post #1 of 2 (496 views)
Permalink
User-defined variables: why not?

Hi,

In VCL, the fact that you can't create your own variables at runtime
can sometimes be a limitation when writing very complicated configs.
You have to use the variables Varnish already has defined for you;
that is, resp.*, etc. You can of course use HTTP headers as temporary
variables, but that seems like a hack to me.

My question is: why doesn't VCL let you do custom variables? If I'm
not mistaking, a .vcl file is just an easy-to-read and easy-to-code
version of a C script (.vcl is compiled as .c at runtime), and it's
not too hard to create variables in C. Are user-defined variables ever
going to appear in VCL, or is that out of the scope of the Varnish
Cache project (if so, why)?

Thanks,
Michael

_______________________________________________
varnish-misc mailing list
varnish-misc [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc


j.gareth.light at gmail

Mar 30, 2012, 12:59 AM

Post #2 of 2 (491 views)
Permalink
Re: User-defined variables: why not? [In reply to]

On Mar 30, 2012 3:27 AM, "Michael Save" <savetheinterpod [at] gmail> wrote:
>
> Hi,
>
> In VCL, the fact that you can't create your own variables at runtime
> can sometimes be a limitation when writing very complicated configs.
> You have to use the variables Varnish already has defined for you;
> that is, resp.*, etc. You can of course use HTTP headers as temporary
> variables, but that seems like a hack to me.
>
> My question is: why doesn't VCL let you do custom variables? If I'm
> not mistaking, a .vcl file is just an easy-to-read and easy-to-code
> version of a C script (.vcl is compiled as .c at runtime), and it's
> not too hard to create variables in C. Are user-defined variables ever
> going to appear in VCL, or is that out of the scope of the Varnish
> Cache project (if so, why)?
>
> Thanks,
> Michael
>
> _______________________________________________

You may find this helpful:
https://github.com/varnish/libvmod-var

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.