How can I clear fastCGI cache via a hook?

Hi,

FastCGI is really great and keep my responses time around 40ms which is really aweosome !
But when I save anything in my app, in order to see changes I have to manually hit the clear cache button from Cleavr, is there a simple way or a command to create a hook in my app for that ?

Thanks,

Jérémy.

Right now, there is no way to clear the cache with a hook but we’ll add it very soon.

1 Like

Thanks you Ashok !
It is great if it will be add soon, in the meantime, what do you recommand to clear the cache from my app ? I don’t think to have the rights inside my webapps folder to flush totally the “root” nginx cache right ?

Another question, do you planned to let us modify from the cleavr backoffice the cache settings file ? It is read-only actually. And maybe in the same time to have the nginx config file editable too ? That would be great !

Thanks you,

Jérémy.

Hi @Jerem -

You can edit NGINX cache settings currently at server > site > nginx and the NGINX general config at server > services > click wrench icon.

I hope this helps!

Hi @amiedema !

Thanks you,
For server > Site > Nginx, do you mean this view ?


Because I have nothing more from this path. And those settings are not editable by myself, I have this error if I update :

Method PATCH is not allowed for this operation. Only GET methods are allowed.

Thanks you for the help for the globals NGINX, I wasn’t sure about it because it looks like more to a simple key/value like the .env editor availbale per app/site.
Can I edit here something like that ?

location ~ \.(gif|jpg|png)$ {
    root /mypath/where/images;
    other rules ...
}

It shouldn’t be displaying that message; I’ll check it out to see if there is a bug.

For the NGINX global config; That area was made more for key-value pairs; though the text-area may work depending on the need. The input is included within http portion of nginx.conf.

1 Like

Thanks you that’s a lot more clearer !

I found the cache update issue; fix will be in the next release.

Hey @Jerem -

The NGINX Cache update fix has been released.

For the NGINX global setting example you provided, we’ll look at making those types of config changes more readily available from within Cleavr in the future. You can always update via SSH’ing into the server in the meantime.

Also, I forgot to mention, we have the hook you requested in test right now. :slight_smile:

I confirm this work @adam thanks you !
Glad to hear about the clear cache hook !

About NGINX config file, I could definitively ssh to my server but I was thinking about letting us edit directly from the site config in cleavr the current “/etc/nginx/site-enabled/my-current-app-or-site.conf” file.

1 Like

Hey @Jerem,

The clear cache hook is now available. It’s located on the NGINX Cache screen (server > site > cache).

If you give it a try, let us know how it works for you! :smile: