Custom.css is cached forever

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
garfy
Registered User
Posts: 290
Joined: Sun Jul 25, 2004 8:37 am

Custom.css is cached forever

Post by garfy » Mon Jul 23, 2018 11:30 am

I add some custom code to custom.css and then clear the cache in phpbb ACM

nothing happens.....custom.css works...it is added to cssstyles main css file....but clearing cache does not affect it....
same as with 3.1 version

User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 3152
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: Custom.css is cached forever

Post by HiFiKabin » Mon Jul 23, 2018 12:03 pm

You also need to clear your browsers cache

Browsers vary but it can usually be accomplished:
  • For Windows and Linux using: Ctrl + F5 or Shift + Reload
  • For Mac using: (Cmd) + R.

v12mike
Registered User
Posts: 231
Joined: Thu Jul 09, 2015 5:03 pm

Re: Custom.css is cached forever

Post by v12mike » Sun Jul 29, 2018 3:46 pm

The problem is that .css that are loaded by the stylesheet.css file are not automatically up-versioned by a cache purge, in the way that most other assets are. This is a fundamental limitation of using a stylesheet.

I recently proposed a patch for phpBB to work around this issue, but it relies on the web server supporting mod-rewrite. See https://tracker.phpbb.com/browse/PHPBB3-15710

There does not seem to be a lot of enthusiam for pulling this patch into phpBB, so I am not sure whether to progress it.

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2796
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Custom.css is cached forever

Post by thecoalman » Sun Jul 29, 2018 4:12 pm

Another option is If you right click and select developer tools there should be option to force it to bypass the browser cache.

You really need to work on this is local environment and then deploy it when you are satisfied. You can insure your visitors get updated version by editing stylesheet.css before deploying it.

Code: Select all

/*  phpBB3 Style Sheet
    --------------------------------------------------------------
	Style name:			prosilver (the default phpBB 3.2.x style)
	Based on style:
	Original author:	Tom Beddard ( http://www.subblue.com/ )
	Modified by:		phpBB Limited ( https://www.phpbb.com/ )
    --------------------------------------------------------------
*/

@import url("normalize.css?v=3.2");
@import url("base.css?v=3.2");
@import url("utilities.css?v=3.2");
@import url("common.css?v=3.2");
@import url("links.css?v=3.2");
@import url("content.css?v=3.2");
@import url("buttons.css?v=3.2");
@import url("cp.css?v=3.2");
@import url("forms.css?v=3.2");
@import url("icons.css?v=3.2");
@import url("colours.css?v=3.2");
@import url("responsive.css?v=3.2");
@import url("custom.css?v=3.2");
Let's suppose you edited custom.css?v=3.2, change to custom.css?v=3.2.1. Upload to your server and purge the cache, when you purge the cache the changes should take effect.

garfy
Registered User
Posts: 290
Joined: Sun Jul 25, 2004 8:37 am

Re: Custom.css is cached forever

Post by garfy » Sun Jul 29, 2018 5:35 pm

but I think in 3.2 works kind of ok, in 3.1 it took days till I saw any change......
If you put in your code any existing style sheet, the changes are visible after you clear the cache....but if you use custom css, which seems very logical to do then it takes a little more time to see the changes..

User avatar
canonknipser
Registered User
Posts: 1598
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Custom.css is cached forever

Post by canonknipser » Sun Jul 29, 2018 7:15 pm

garfy wrote:
Sun Jul 29, 2018 5:35 pm
but if you use custom css, which seems very logical to do then it takes a little more time to see the changes..
that's because css is cached by your browsers cache, not by phpBB cache system. To make changes visible, you need to change the url (which is done by changing the url parameter?v=3.2 to some other value, as thecoalman already mentioned:
thecoalman wrote:
Sun Jul 29, 2018 4:12 pm
Let's suppose you edited custom.css?v=3.2, change to custom.css?v=3.2.1.
This will force your browser to refresh the cached file because it has a different url.

Or, simply clean your browsers cache (hit ctrl + F5)
Last edited by canonknipser on Mon Jul 30, 2018 4:51 am, edited 1 time in total.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

User avatar
Lumpy Burgertushie
Registered User
Posts: 64868
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Custom.css is cached forever

Post by Lumpy Burgertushie » Sun Jul 29, 2018 7:58 pm

also, your host may have a cache in place . that is usually what is happening when it takes days for the changes to show.

robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2796
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Custom.css is cached forever

Post by thecoalman » Mon Jul 30, 2018 8:14 am

canonknipser wrote:
Sun Jul 29, 2018 7:15 pm
This will force your browser to refresh the cached file because it has a different url.

Or, simply clean your browsers cache (hit ctrl + F5)
What I said was:
You can insure your visitors get updated version by editing stylesheet.css before deploying it.

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 2 guests