Over-riding my viewers' cached stylesheets

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Scam Warning
Locked
Pseudonym
Registered User
Posts: 173
Joined: Mon Jan 26, 2004 8:37 am

Over-riding my viewers' cached stylesheets

Post by Pseudonym »

Hi there, I have a simple question:

I've updated my stylesheet, and refreshed the PHPBB cache. The new stylesheet version is now available. However, my regular visitors have the old version cached in their browser, and it doesn't download the new version unless they hit the browser's Refresh button.

Is there an easy way of getting around this?

My first thought was to rename the stylesheet, and change the HTML template so the browser was forced to look for a new file. But the templating system uses a variable {T_STYLESHEET_LINK} so it's not that easy.

I'm sure this must be a widespread problem for phpbb style developers - what's the solution?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52115
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Over-riding my viewers' cached stylesheets

Post by Brf »

The HTML template files should not be a problem, since their timestamps have changed.
The problem is with the CSS stylesheet, since the user's browser uses style.php to load that.
You can trick the users' browsers into reloading that by writing a new style.php.
Pseudonym
Registered User
Posts: 173
Joined: Mon Jan 26, 2004 8:37 am

Re: Over-riding my viewers' cached stylesheets

Post by Pseudonym »

Hi Brf. That's when I mean - I can rename style.php to style2.php and that would force the browsers to look for a new file. But the HTML template doesn't actually contain style.php. It uses the variable {T_STYLESHEET_LINK} instead. Where can I change the content of this variable?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52115
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Over-riding my viewers' cached stylesheets

Post by Brf »

There is no need to rename style.php, simply rewrite it so its timestamp changes. Users' browsers should be pulling new versions.
Locked

Return to “[3.0.x] Styles Support & Discussion”