phpBB

Development Discussion Board

phpBB's testing ground of bleeding edge code
Advanced search

[RFC|Accepted] Overridable imageset and theme paths for CDNs

Publish your own request for comments or patches for the next version of phpBB. Discuss the contributions and proposals of others. Upcoming releases are 3.1/Ascraeus and 3.2/Arsia.

Re: [RFC|Accepted] Overridable imageset and theme paths for

Postby Oleg » Fri Sep 03, 2010 6:41 am

All occurrences of image references in phpbb can (currently) be found with a fairly small number of regular expressions. I run several global search and replace operations to append timestamps to my asset urls in deployment. These timestamps allow me to cache assets indefinitely via expires headers (while serving them from the same vhost as the scripts).

I suspect it would not be too hard to transform relative paths into absolute urls, based on which file the paths occur in.

Now, this assumes you are not generating stylesheets on the fly via style.php. If you do, if my memory is correct you would need some less trivial changes to phpbb code to timestamp assets.
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Re: [RFC|Accepted] Overridable imageset and theme paths for

Postby Rahul » Fri Apr 29, 2011 5:59 am

I need to ask 1 thing... how can these changes automatically select http or https depending upon the way header request them?
Rahul
Registered User
 
Posts: 3
Joined: Mon Aug 30, 2010 3:23 pm

Re: [RFC|Accepted] Overridable imageset and theme paths for

Postby Sierron » Fri Apr 29, 2011 7:59 am

+1

I would love to have that without needing to rewrite everything.
GravityDK wrote:I would use a subdomain to get the parallel downloads: like subdomain.mysite.com.
That :)
User avatar
Sierron
Registered User
 
Posts: 62
Joined: Wed Aug 25, 2010 11:41 am

Re: [RFC|Accepted] Overridable imageset and theme paths for

Postby Rahul » Fri Jul 22, 2011 8:20 am

Code: Select all
imageset:
in session.php
Code: Select all$img_data['src'] = 'http://cdn.varjanta.com/static/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];


What about theme images? Images that load from theme folder...what setting we must do?
Rahul
Registered User
 
Posts: 3
Joined: Mon Aug 30, 2010 3:23 pm

Re: [RFC|Accepted] Overridable imageset and theme paths for

Postby nickvergessen » Fri Sep 23, 2011 9:45 pm

Well we removed the imagesets, so this RFC needs to be adjusted a bit ;)
cheers nickvergessen :geek:
Member of phpBB Development-Team
No Support via PM — My MODs for phpBB 3.0.x
User avatar
nickvergessen
Development Team
Development Team
 
Posts: 350
Joined: Sun Oct 07, 2007 11:54 am
Location: Esslingen, Germany

Re: [RFC|Accepted] Overridable imageset and theme paths for

Postby Oleg » Fri Jan 20, 2012 5:28 am

http://www.phpbb.com/community/viewtopi ... #p13102378

Oleg wrote:It is fairly straightforward to find all references to static assets in phpbb via regular expressions. The challenge is that image urls and such are relative, not absolute. You would have to process each level of files separately to properly convert relative to absolute urls. Then you could prepend host and path to the urls to make all urls point to the cdn of your choice.

You can use my asset timestamping script for inspiration: https://gist.github.com/1645495 (built and tested against phpbb 3.0.5 or so).
Oleg
3.1 Release Manager
3.1 Release Manager
 
Posts: 1150
Joined: Tue Feb 23, 2010 2:38 am

Previous

Return to [3.x] RFCs

Who is online

Users browsing this forum: No registered users and 7 guests