Skip to content
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

Configure caching settings from admin panel #108

Open
xplosionmind opened this issue Feb 5, 2023 · 1 comment
Open

Configure caching settings from admin panel #108

xplosionmind opened this issue Feb 5, 2023 · 1 comment

Comments

@xplosionmind
Copy link

I am getting crazy trying to manually configure Nginx to cache static resources…

It would be great if such configuration could be performed right within YunoHost, without needing to meddle with the Nginx file.

@xplosionmind xplosionmind changed the title Add caching configuration for static resources Configure caching settings from admin panel Oct 15, 2023
@xplosionmind
Copy link
Author

xplosionmind commented Oct 15, 2023

To provide more context, here is what I added to my Nginx config, in /etc/nginx/conf.d/tommi.space.d/my_webapp.conf:

        # Cache-Control headers for static assets
        location ~* .(?:webp|jpg|png|svg|aiff|jxl|woff|woff2|wav|mp3|m4a|mov|aac)$ {
                expires 1y;
                add_header Cache-Control "public";
        }
        location ~* .(?:js|json)$ {
                expires 4w;
                add_header Cache-Control "public";
        }
        location ~* .(?:css)$ {
                expires 1w;
                add_header Cache-Control "public";
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant