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.
[RFC|Accepted] Overridable imageset and theme paths for CDNs
Re: [RFC|Accepted] Overridable imageset and theme paths for
I need to ask 1 thing... how can these changes automatically select http or https depending upon the way header request them?
Re: [RFC|Accepted] Overridable imageset and theme paths for
+1
I would love to have that without needing to rewrite everything.
I would love to have that without needing to rewrite everything.
ThatGravityDK wrote:I would use a subdomain to get the parallel downloads: like subdomain.mysite.com.
Re: [RFC|Accepted] Overridable imageset and theme paths for
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'];
- nickvergessen
- Former Team Member
- Posts: 733
- Joined: Sun Oct 07, 2007 11:54 am
- Location: Stuttgart, Germany
- Contact:
Re: [RFC|Accepted] Overridable imageset and theme paths for
Well we removed the imagesets, so this RFC needs to be adjusted a bit
Member of the Development-Team — No Support via PM
Re: [RFC|Accepted] Overridable imageset and theme paths for
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).
Re: [RFC|Accepted] Overridable imageset and theme paths for
Apologies for my poor knowledge of phpBB inner working concerning RFCs -- did this find its way to the 3.1 release? I saw some external cdn new features that enables usage of Google for jquery and such, but I am not seeing the possibility to add a separate domain for a CDN for attachments/styles/avatars/etc.GravityDK wrote:I just wanted to cheer for this being accepted.
I would use a subdomain to get the parallel downloads: like subdomain.mysite.com.
I believe what I've read above will allow that usage.
Thanks a lot for your help!
Re: [RFC|Accepted] Overridable imageset and theme paths for CDNs
For me this is still the single most wanted feature. After recently upgrading to 3.2 I now have the painful task to edit all my templates yet again to change all static content to be served by the static server.
For example on this board, this dynamic apache php served image ...
The RFC has been accepted previously but no progress made. I am fed up of coding it all by hand every template change and am happy to throw in a bit of sponsorship if anyone is willing to take up the task.
For example on this board, this dynamic apache php served image ...
http://area51.phpbb.com/phpBB/download/file.php?avatar=48350_1268240559.png
could be served from this static lighttpd server ...http://static.phpbb.com/phpBB/download/avatars/48350_1268240559.png
The RFC has been accepted previously but no progress made. I am fed up of coding it all by hand every template change and am happy to throw in a bit of sponsorship if anyone is willing to take up the task.