Purge the cache automatically ?

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
djorlando
Registered User
Posts: 110
Joined: Sun Oct 21, 2012 7:46 am
Location: Bruxelles

Purge the cache automatically ?

Post by djorlando » Tue Apr 18, 2017 8:25 am

Hi,
Is it possible we can purge the cache automatically when installing an extension?

I have included some custom css style for the adm html file inside the acme_demo extension, but every time i want to re-install it, i have to purge the cache first.

Thank you !
Last edited by djorlando on Wed Apr 19, 2017 10:21 am, edited 1 time in total.

User avatar
david63
Registered User
Posts: 16328
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Purge the cache automatically ?

Post by david63 » Tue Apr 18, 2017 9:31 am

Part of the extension enable/disable/delete data routine is to purge the cache
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
djorlando
Registered User
Posts: 110
Joined: Sun Oct 21, 2012 7:46 am
Location: Bruxelles

Re: Purge the cache automatically ?

Post by djorlando » Tue Apr 18, 2017 9:46 am

david63 wrote:
Tue Apr 18, 2017 9:31 am
Part of the extension enable/disable/delete data routine is to purge the cache
Hello David ,
Yes i'm aware of that, what i need is a possibility to automatically purge the cache when i hit enable extension ( or on first install ) . It's strange because for example if i hit enable on my extension , the cache is not purged ...but if i install another extension after that , the cache is purged.

So i'm sure there's a way we can automatically purge the cache when pressing "enable" or installing first time the extension. But how ? :roll:

User avatar
david63
Registered User
Posts: 16328
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Purge the cache automatically ?

Post by david63 » Tue Apr 18, 2017 10:14 am

djorlando wrote:
Tue Apr 18, 2017 9:46 am
if i hit enable on my extension , the cache is not purged
That sounds as if there may be a problem with your extension not completing. Every extension that I have enabled (and there have been many, for one reason or another) has purged the cache.

If your problem is just with your style changes then set ACP > Load settings > Recompile stale style components = Yes
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
djorlando
Registered User
Posts: 110
Joined: Sun Oct 21, 2012 7:46 am
Location: Bruxelles

Re: Purge the cache automatically ?

Post by djorlando » Tue Apr 18, 2017 10:24 am

If your problem is just with your style changes then set ACP > Load settings > Recompile stale style components = Yes
Already checked.
That sounds as if there may be a problem with your extension not completing. Every extension that I have enabled (and there have been many, for one reason or another) has purged the cache.
I don't think so. It's the default acme demo extension. The only difference is that the custom css is for an ACP element, not for prosilver style. So maybe the ACP css cache is not purged .

You could try and see that if you add a custom css code inside your extension adm folder, the changes are not visible ( unless you purge the cache after ) on first install or when hitting enable.. Even if the ACP > Load settings > Recompile stale style components = Yes

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3768
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Purge the cache automatically ?

Post by kasimi » Tue Apr 18, 2017 11:55 am

Check the source code of the page and find the CSS file's <link> element. The href should have a parameter ?assets_version=xyz. Re-enable the extension and check if the xyz has changed. If it has, your browser might causing your issues.

User avatar
djorlando
Registered User
Posts: 110
Joined: Sun Oct 21, 2012 7:46 am
Location: Bruxelles

Re: Purge the cache automatically ?

Post by djorlando » Tue Apr 18, 2017 12:43 pm

It doesn't even display the events content ( my custom css stylesheets ) if i don't hit purge the cache after re-enabling the extension. Yes the version is changing with two numbers bigger every time i re-enable + purging the cache.
If it has, your browser might causing your issues.
I have tested in both, mozilla and chrome..the same issue.

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25230
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Purge the cache automatically ?

Post by Paul » Tue Apr 18, 2017 6:08 pm

Instead of arguing about if something does happen or not you should post your code (Preferbly on github) so we can actually help you.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
djorlando
Registered User
Posts: 110
Joined: Sun Oct 21, 2012 7:46 am
Location: Bruxelles

Re: Purge the cache automatically ?

Post by djorlando » Wed Apr 19, 2017 7:29 am

Paul wrote:
Tue Apr 18, 2017 6:08 pm
Instead of arguing about if something does happen or not you should post your code (Preferbly on github) so we can actually help you.
i'm not arguing i'm explaining why i'm right :D . Just kidding.

As i said it's just the fresh new acme/demo extension. I have only placed a demo.css file inside ext/acme/demo/adm/style folder and included that demo.css stylesheet inside the event acp_overall_header_head_append.

If anyone wanna see what i'm talking about, just download it from here.

Normally when you'll enable it , if you have this set to yes ACP > Load settings > Recompile stale style components = Yes , you should see this:
demoacme.png
But you'll have to purge the cache first , to see the demo.css stylesheet applied .
Attachments
acme.zip
(21.79 KiB) Downloaded 16 times
Last edited by djorlando on Wed Apr 19, 2017 10:21 am, edited 1 time in total.

User avatar
david63
Registered User
Posts: 16328
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Purge the cache automatically ?

Post by david63 » Wed Apr 19, 2017 7:46 am

You are not loading your .css file correctly. It needs to have the vendor and namespace as part of the include.

Try using <!-- INCLUDECSS @acme_demo/demo.css/ -->
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
djorlando
Registered User
Posts: 110
Joined: Sun Oct 21, 2012 7:46 am
Location: Bruxelles

Re: Purge the cache automatically ?

Post by djorlando » Wed Apr 19, 2017 8:05 am

i just did and it gives an error .

EDIT:

I had to place it without "/" at the end to avoid the error:

Code: Select all

<!-- INCLUDECSS @acme_demo/demo.css -->
But we still have to purge the cache.
Last edited by djorlando on Wed Apr 19, 2017 3:12 pm, edited 2 times in total.

User avatar
david63
Registered User
Posts: 16328
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Purge the cache automatically ?

Post by david63 » Wed Apr 19, 2017 2:34 pm

djorlando wrote:
Wed Apr 19, 2017 8:05 am
I had to place it without "/" at the end to avoid the error:
Sorry - typo
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Post Reply

Return to “Extension Writers Discussion”