Re: Is gerrit support apache static content cache ?

57 views
Skip to first unread message

Luca Milanesio

unread,
Sep 22, 2021, 2:21:02 PM9/22/21
to Repo and Gerrit Discussion, Luca Milanesio, Steve


On 22 Sep 2021, at 18:02, Steve <palakk...@gmail.com> wrote:

Hello everyone, 

I was trying to have a seperate caching mechanism using the Apache to Cache Static Content via mod_disk_cache (https://confluence.atlassian.com/conf59/configuring-apache-to-cache-static-content-via-mod_disk_cache-792499657.html).

But its seem the cache is not getting populated or cached in the configured location of Apache. I suspect this might not allowed by gerrit. PFB 

1) .css getting from memory cache 

<memory_cache.PNG>

2) html getting from disk_cache , PFA
<disk_cache.PNG>

Could you please let us know is there any restrictions by gerrit to cache the below contents via Apache, 

The selected files/folders are as follows:
.ttf
.css
.woff
.woff2
.png
.html
.jpg
.ico
Path:
/gerrit/bower_components/*
/gerrit/Documentation/*
/gerrit/fonts/*
*/static/*
/gerrit/styles/*

I believe the best option would be to just put all the Gerrit static assets onto Apache HTTPD directly, without having Gerrit to serve them.
You can then use all the caching you want at Apache level.

See more details on the CDN configuration in Gerrit at [1].

HTH

Luca.






--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/4918a311-5fc7-44d0-bd59-387d99771273n%40googlegroups.com.
<memory_cache.PNG><disk_cache.PNG>

Björn Pedersen

unread,
Sep 27, 2021, 2:50:41 AM9/27/21
to Repo and Gerrit Discussion
One thing I  see with gerrit 3.3: e.g. the fonts  or images are served with 
  
cache-control: private, max-age=900, must-revalidate

So they can only be cached on a per-client basis.
I  don't  think that really makes sense here, as the fonts or logos should not  change often and do not depend on a user/client.

Björn


Luca Milanesio

unread,
Sep 27, 2021, 4:58:13 AM9/27/21
to Repo and Gerrit Discussion, Luca Milanesio, Björn Pedersen
I just did it now on gerrit-review.googlesource.com and I get:

GET https://fonts.gstatic.com/s/roboto/v29/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2
cache-control: public, max-age=31536000

However, on review.gerrithub.io I get:

GET https://review.gerrithub.io/fonts/opensans-latin-400.woff2
cache-control: private, max-age=900, must-revalidate

I believe that is because on review.gerrithub.io we don’t use the cdnPath and the content is returned by Gerrit servlet.

Can you raise a bug for that use-case?
I agree that 'cache-control: private’ doesn’t make sense for static assets like fonts.

Luca.

Björn Pedersen

unread,
Sep 27, 2021, 6:21:00 AM9/27/21
to Repo and Gerrit Discussion

I just did it now on gerrit-review.googlesource.com and I get:

GET https://fonts.gstatic.com/s/roboto/v29/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2
cache-control: public, max-age=31536000

However, on review.gerrithub.io I get:

GET https://review.gerrithub.io/fonts/opensans-latin-400.woff2
cache-control: private, max-age=900, must-revalidate

I believe that is because on review.gerrithub.io we don’t use the cdnPath and the content is returned by Gerrit servlet.

Can you raise a bug for that use-case?

Reply all
Reply to author
Forward
0 new messages