• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

CDN set up question

Bombardier

Active member
#1
Ok so I am setting up a CDN with my webhost and one of the things they tell me I need to do is

Your site code will need updated to call these assets via the new
http://cdn.militaryimgaes.net URL (rather than via a relative path for
instance). This then allows the site to fetch those images from the CDN
rather than from the local directories.
Where do I make this change to files within my XF root
 

Bombardier

Active member
#6
Thank you
Yes it hasn't been set up yet I am asking these questions in advance of that.
So my zone url will be cdn.militaryimages.net? I do also have a sub domain set up as instructed by my web host
 

Bombardier

Active member
#9
Should this work straight away, after setting all that up exactly as described all my images on site disappeared, I waited about 5 mins before reverting

should I add that last line of code (relating to cache) or does that relate to something completely different

Do I need to change the domain mapping of my sub domain to point towards my XF root?
 
Last edited:

Mouth

Well-known member
#11
Should this work straight away, after setting all that up exactly as described all my images on site disappeared, I waited about 5 mins before reverting

should I add that last line of code (relating to cache) or does that relate to something completely different

Do I need to change the domain mapping of my sub domain to point towards my XF root?
Make sure your CDN is working correctly before making any changes in XF!
Eg. If you have mydomain.com/js/custom.js then cdn.mydomain.com/js/custom.js should work too.
 
#12
Ok I believe my cdn.militaryimages.net is working as it is parsing my site fine.
However when I insert the code to my config all my images disappear
If I revert the config but leave the cdn address in the styles - general settings images are back but I think it lacks the (for want of the accurate termnology) the overlay that dulls down the colours...hope that makes sense.

any ideas
 
#13
Now I realise how stupid I am I was putting www in my cdn url, now without it it works fine
thanks guys although I expect to find problems further down the line
 
#14
I have seen some speed improvement but not as much as I thought I would so I contacted my host again!
This is what they said
I am seeing that most images are in the code with what looks to be dynamic query
strings attached to them, which will prevent the CDN service from properly
caching those. That will slow down access to such files.

For instance, instead of calling an image directly like:

91813-932c1eb482a39ef120ea7eb308d1e4aa.jpg

The site in instead using:

91813-932c1eb482a39ef120ea7eb308d1e4aa.jpg?1416330954

Several of the css and js files also have dynamic query strings added to
them as well
Any ideas how to correct this or will I just have to live with?
 

Marcus

Well-known member
#15
You might tell your cdn to not forward query strings for images. Then it always returns tree.png for requests like tree.png?12 or tree.png?9abc

The query string exists most likely for a reason, though.