Can I use an external ACL helper for "cache allow x" or "cache deny y" ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Can I use an external ACL helper for "cache allow x" or "cache deny y" ?

Eliezer Croitoru
Hey,

I was wondering to myself:
We have lots of acls but I am not sure if it's possible or not.
I want to cache specific files only after a specific amount of times that
they were downloaded requested over a specific period of time.
Now what I want to try is to write an external ACL helper that will work
with a counter in a DB and that will count each url hit.
Then if a specific URL is being hit more then let say 5 times per a period
of time which garbage collection runs or memcached or redis with an
expiration time,
this object will be allowed to be cached.

It's a lot of data on a busy systems but for specific domains it's useful.

Can an external acl helper be used for "cache deny x" or "cache allow y"?

Thanks,
Eliezer

----
Eliezer Croitoru
Linux System Administrator
Mobile: +972-5-28704261
Email: [hidden email]




_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can I use an external ACL helper for "cache allow x" or "cache deny y" ?

Alex Rousskov
On 07/05/2017 03:25 AM, Eliezer Croitoru wrote:

> Can an external acl helper be used for "cache deny x" or "cache allow y"?

Yes, the "cache" directive supports "slow" ACLs, and an external ACL is
a slow ACL:

From http://www.squid-cache.org/Doc/config/cache

> * cache: Checked before Squid makes a hit/miss determination.
> No access to reply information!
> Denies both serving a hit and storing a miss.
> Supports both fast and slow ACLs.

From http://www.squid-cache.org/Doc/config/acl

> acl aclname external class_name [arguments...]
>  # external ACL lookup via a helper class defined by the
>  # external_acl_type directive [slow]

Alex.
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Can I use an external ACL helper for "cache allow x" or "cache deny y" ?

Eliezer Croitoru
Thanks Alex,

I will start with a simple example which supports concurrency.
I will start with a Ruby+memcache\redis simple helper and will move on towards a full blown GoLang based one.

Eliezer

----
Eliezer Croitoru
Linux System Administrator
Mobile: +972-5-28704261
Email: [hidden email]



-----Original Message-----
From: Alex Rousskov [mailto:[hidden email]]
Sent: Wednesday, July 5, 2017 17:37
To: Eliezer Croitoru <[hidden email]>; [hidden email]
Subject: Re: [squid-users] Can I use an external ACL helper for "cache allow x" or "cache deny y" ?

On 07/05/2017 03:25 AM, Eliezer Croitoru wrote:

> Can an external acl helper be used for "cache deny x" or "cache allow y"?

Yes, the "cache" directive supports "slow" ACLs, and an external ACL is
a slow ACL:

From http://www.squid-cache.org/Doc/config/cache

> * cache: Checked before Squid makes a hit/miss determination.
> No access to reply information!
> Denies both serving a hit and storing a miss.
> Supports both fast and slow ACLs.

From http://www.squid-cache.org/Doc/config/acl

> acl aclname external class_name [arguments...]
>  # external ACL lookup via a helper class defined by the
>  # external_acl_type directive [slow]

Alex.

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Loading...