External CSS file never gets updated

I load an externasl CSS file which is generated by an WP Plugin to my page in pinegrow.

<link href="https://mysite.ddev.site/wp-content/uploads/automatic-css/automatic-gutenberg.css" rel="stylesheet" type="text/css">

This file has now been changed externally, but Pinegrow still loads an old version.

Menu “File / Clear Cache” does not help.

Menu “Open Page in Browser” shows the following file path:

<link href="http://127.0.0.1:40000/https://mysite.ddev.site/wp-content/uploads/automatic-css/automatic-gutenberg.css" rel="stylesheet" type="text/css">

What’s the problem here? How to solve that?
Thanks in advance.

The second link is different to the first one. Are they the same?

yes, sorry. forgot to replace it with “mysite” in my code example above (edited now).
They are the same in real world.

Does the external process of updating the file involves deleting & re-creating the containing folder, /automatic-css/? That could be the reason, as Pinegrow loses tracking the original file.

You could also try reloading the project by right-clicking on the project name in the project panel.

tried that. Does not help.

Could not find any code that removes the whole directory before generating the css files.

At the moment I have created softlinks in the terminal from the generated css files to the Pinegrow project folder. Then it works, but I don’t want to have to do that because it needs file exclusion from export and also in .gitignore.

Is this file outside the project folder that’s opened in Pinegrow?

Yes, Wordpress is installed on another folder.

It is possible that files outside the current project are not watched, will wait for @matjaz to confirm this.

Your softlink hack, though inconvenient, might be a good solution in this instance.

1 Like

I’ve found the CSS files in the “mapped_urls” folder. They are copied as soon as I add the external CSS file via Stylesheet Manager:

Maybe this is the reason why the loaded CSS filesnever get’s updated? @matjaz can you please enlighten me.

That could be it, I missed noticing that its not loaded from the file system.

I don’t think urls resources can be automatically refreshed, as there is no way to watch that file for changes.

Why not load it via the file system directly, which is what your softlinks hack is, isn’t it?

reverencing the files from outside the project folder was not working using relative path.

I do not want them to be refreshed live when editing. I just want them to be loaded as external files but they was not changing - i think now this has to do with the mapped_urls thing - the files are copied and maybe used instead of loaded form the real URL.

Looks like you are just using that stylesheet just like how we would use say bootstrap css from the cdn (https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css).

So, clearing the cache & restarting pinegrow should help with pulling the fresh stylesheet.

Not sure where mapped-urls come into play here, Im probably missing something. Lets see what others think.