[Tinhte] Image Attachment Optimization & CDN Support

[Tinhte] Image Attachment Optimization 2.3.0 20170315

No permission to download
Doesn't work with my subdomain that's set up with cloudflare either. I signed up for MaxCDN last night but it looks like I might not even bother if it's not working with MaxCDN.
Thank you for confirming the CDN issue. :)

I'm now using a mix of MaxCDN with Cloudflare. Seems to have made things really fast.

MaxCDN covers most of my images and js files, while CloudFlare takes on the rest.
 
Thank you for confirming the CDN issue. :)

I'm now using a mix of MaxCDN with Cloudflare. Seems to have made things really fast.

MaxCDN covers most of my images and js files, while CloudFlare takes on the rest.
Were you able to get it working with attachments?
 
Word of advice.... Webpagetest.org is useless. I've had a single html file

PHP:
<html>
<body>
<b>Hello world</b>
</body>
</html>

End up with a poor rating.

I don't trust that site.... I also do not believe in the "first byte to live theory" and yes, I call it a theory.... That 1st byte is useless... Give me the last byte... That is what really matters because it's the last bit that tells me how fast or slow your site is. How long does it take to load?!

With this said... Google Translate ... Which if you notice I have in my header... Tosses that right off.
 
I'd say the feel of your site is the same speed as this website which is really good considering you have over a hundred addons and customizations right?

But I'm only talking about from my perspective. The whole point of me even bothering with CDN's in the first place is not for me but for those peeps who live on the other side of the world like the threadstarter Dinh Thanh or Vicky from my site or even UK peeps.
 
I'd say the feel of your site is the same speed as this website which is really good considering you have over a hundred addons and customizations right?
Over 300 collectively.

That is modifications, skins, add-ons, template edits, file edits, and 3rd party products.

So yes... I think I'm doing good. But if you know how to improve it... I'm listening.
 
According to that test

4.4 seconds for it to fully load. I like 4 seconds.

Firebug tells me 9 seconds. I'm sure that site didn't wait for Google Translate. 9 seconds is still good. It could be better, but it's only 9 seconds.
The first negative letter grade is due to webpagetest.org not liking cloudflare. Happens to me too.
 
Over 300 collectively.

That is modifications, skins, add-ons, template edits, file edits, and 3rd party products.

So yes... I think I'm doing good. But if you know how to improve it... I'm listening.
Well earlier in the thread Anthony mentioned that using another domain as a 'cookieless domain' does more harm than good even though other sites claim the opposite.

It's been in my experience that what he said was true. I had bought the other domain just to see if what those blogs were saying was true and it was either the same speed or slower.
 
Well earlier in the thread Anthony mentioned that using another domain as a 'cookieless domain' does more harm than good even though other sites claim the opposite.

It's been in my experience that what he said was true. I had bought the other domain just to see if what those blogs were saying was true and it was either the same speed or slower.
It's an on going debate among web master.

A cookie less domain will fully cache everything vs a sub domain name. This means less hits required for content. This has been proven.

The argument is that by using another domain name, that you add a DNS look up. And that this slows things down.

Do you know how fast a dns look up is when they're both on the same server, same location, and using a CDN to help bring that location closer to you?!

I'll stick with the cookie less domain knowing that I'm saving resources for content. And that things are fully cached for quicker load (because the cache is now on your PC ... ie... localhost)
 
Thank you for confirming the CDN issue. :)

I'm now using a mix of MaxCDN with Cloudflare. Seems to have made things really fast.

MaxCDN covers most of my images and js files, while CloudFlare takes on the rest.

Just make a test account on MaxCDN.com. Set it up then working without any issue.
There is no issue with my addon. I think Adam have issue with .htaccess or something.
MaxCDN setup is standard. Nothing was changed.
 

Attachments

  • Screen Shot 2012-09-03 at 2.33.09 PM.webp
    Screen Shot 2012-09-03 at 2.33.09 PM.webp
    3.1 KB · Views: 16
  • Screen Shot 2012-09-03 at 2.44.49 PM.webp
    Screen Shot 2012-09-03 at 2.44.49 PM.webp
    6.9 KB · Views: 16
Just make a test account on MaxCDN.com. Set it up then working without any issue.
There is no issue with my addon. I think Adam have issue with .htaccess or something.
MaxCDN setup is standard. Nothing was changed.
So it's not your addon, just our htaccess? What's yours look like?

Adam post yours please.

This is mine.

PHP:
#      Mod_security can interfere with uploading of content such as attachments. If you
#      cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#      SecFilterEngine Off
#      SecFilterScanPOST Off
#</IfModule>
 
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default
 
<IfModule mod_rewrite.c>
  Options +FollowSymLinks
        RewriteEngine On

RewriteRule ^/([^/]*)/([^/]*)$ /$1.php/$2
 
        #      If you are having problems with the rewrite rules, remove the "#" from the
        #      line that begins "RewriteBase" below. You will also have to change the path
        #      of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
RewriteCond %{HTTP_HOST} ^8thos\.com$ [NC]
RewriteRule ^(.*)$ http://www.8thos.com/$1 [R=301,L]
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data|js|styles|install) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^/threads/ /forum/threads
RewriteRule ^/forums/ /forum/forums
</IfModule>
 
So it's not your addon, just our htaccess? What's yours look like?

Adam post yours please.

This is mine.

PHP:
#      Mod_security can interfere with uploading of content such as attachments. If you
#      cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#      SecFilterEngine Off
#      SecFilterScanPOST Off
#</IfModule>
 
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default
 
<IfModule mod_rewrite.c>
  Options +FollowSymLinks
        RewriteEngine On
 
RewriteRule ^/([^/]*)/([^/]*)$ /$1.php/$2
 
        #      If you are having problems with the rewrite rules, remove the "#" from the
        #      line that begins "RewriteBase" below. You will also have to change the path
        #      of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
RewriteCond %{HTTP_HOST} ^8thos\.com$ [NC]
RewriteRule ^(.*)$ http://www.8thos.com/$1 [R=301,L]
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data|js|styles|install) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^/threads/ /forum/threads
RewriteRule ^/forums/ /forum/forums
</IfModule>


I'm using Xenforo standard .htaccess.
Could you give me a thread url with image attachment? Then can you send me your CDN Config (domain & original)?
 
So it's not your addon, just our htaccess? What's yours look like?

Adam post yours please.

This is mine.

PHP:
#      Mod_security can interfere with uploading of content such as attachments. If you
#      cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#      SecFilterEngine Off
#      SecFilterScanPOST Off
#</IfModule>
 
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default
 
<IfModule mod_rewrite.c>
  Options +FollowSymLinks
        RewriteEngine On
 
RewriteRule ^/([^/]*)/([^/]*)$ /$1.php/$2
 
        #      If you are having problems with the rewrite rules, remove the "#" from the
        #      line that begins "RewriteBase" below. You will also have to change the path
        #      of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
RewriteCond %{HTTP_HOST} ^8thos\.com$ [NC]
RewriteRule ^(.*)$ http://www.8thos.com/$1 [R=301,L]
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data|js|styles|install) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^/threads/ /forum/threads
RewriteRule ^/forums/ /forum/forums
</IfModule>

I've used the default XenForo htaccess on my test site, which has nothing else installed, only this modification.

However on my live site....

PHP:
AddHandler application/x-httpd-php54 php
 
Options FollowSymLinks MultiViews -Indexes
 
<IfModule mod_php5.c>
php_value max_execution_time 120
php_value max_input_time 300
php_value memory_limit 256M
</IfModule>
 
ServerSignature Off
ServerTokens Prod
 
<Files .htaccess>
order allow,deny
deny from all
</Files>
 
<Files "admin.php">
Order Deny,Allow
Deny from all
Allow from 71.xx.x.x
Allow from 86.x.x.xx
</Files>
 
 
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
 
 
#    Mod_security can interfere with uploading of content such as attachments. If you
#    cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
#    SecFilterEngine Off
#    SecFilterScanPOST Off
#</IfModule>
 
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 500 default
 
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.sociallyuncensored.eu [NC]
RewriteCond %{HTTP_HOST} !^([^.]+).sociallyuncensored.eu [NC]
RewriteRule (.*) http://www.sociallyuncensored.eu/$1 [R=301,L]
 
    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo
 
    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
 
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
 
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC,OR]
RewriteCond %{THE_REQUEST} (\\r|\\n|%0A|%0D) [NC,OR]
 
RewriteCond %{HTTP_REFERER} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{HTTP_COOKIE} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{REQUEST_URI} ^/(,|;|:|<|>|”>|”<|/|\\\.\.\\).{0,9999} [NC,OR]
 
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|curl|wget|python|nikto|scan) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
 
#Block mySQL injects
RewriteCond %{QUERY_STRING} (;|<|>|’|”|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|cast|set|declare|drop|update|md5|benchmark) [NC,OR]
 
RewriteCond %{QUERY_STRING} \.\./\.\. [OR]
 
RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
RewriteCond %{QUERY_STRING} \.[a-z0-9] [NC,OR]
RewriteCond %{QUERY_STRING} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC]
# Note: The final RewriteCond must NOT use the [OR] flag.
 
# Return 403 Forbidden error.
RewriteRule .* index.php [F]
</IfModule>
<FilesMatch "\.(gif|ico|jpg|jpeg|png|flv|swf|pdf|mp3|mp4|xml|txt|js|css)$">
Header set Cache-Control "max-age=691200"
</FilesMatch>
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
    AddOutputFilterByType DEFLATE application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 60 seconds"
ExpiresByType text/html "access plus 60 seconds"
ExpiresByType image/gif "access plus 3456000 seconds"
ExpiresByType image/jpeg "access plus 3456000 seconds"
ExpiresByType image/png "access plus 3456000 seconds"
ExpiresByType text/css "access plus 3456000 secondss"
ExpiresByType text/javascript "access plus 3456000 seconds"
ExpiresByType application/x-javascript "access plus 3456000 seconds"
ExpiresByType text/xml "access plus 60 seconds"
ExpiresByType image/x-icon "access plus 1 days"
ExpiresByType image/ico "access plus 1 days"
</IfModule>
 
Adam Howard,
Please turn off my addon then check to see if your webserver or MaxCDN still add "/s/" to attachment url?
We should find why Web Server or MaxCDN add "/s/" or your attachment urls?

Try with this url:
Code:
http://cdn.sociallyuncensored.com/forums/attachments/www-sociallyuncensored-eu-2012-8-29-18-35-24-png.686/

And coud you send me Max CDN Pull Zone config screen?
 
I'm using Xenforo standard .htaccess.
Could you give me a thread url with image attachment? Then can you send me your CDN Config (domain & original)?
This is how I set my cdn up. http://xenforo.com/community/resour...pt-and-static-images-from-cloudflare-cdn.784/

Only difference is I did a cname entry for both http://cdn.8thos.com and http://www.cdn.8thos.com and point it to Cloudflare.

This is an attachment url http://www.8thos.com/attachments/cantphase-jpg.1904/

from this post: http://www.8thos.com/threads/upgraded-to-a-semi-dedicated-server.17940/#post-137958

Your addon is turned off at the moment.
 
OK.
Could you please send me your CDN Pull Zone setup screen via PM?

Updated:
Ah, you are using CloudFlare, in this case, Did you use A or CName for cdn.8thos.com?
 
Hey what do you know? It works now. Guess I didn't need any help after all. I just needed to stop using cloudflare.

I followed this guide: http://xenforo.com/community/thread...-and-javascript-done.14902/page-3#post-318439

5 Stars now bro!

Although you rated 5 stars, I'm still not agree with you :)
>> 5 Stars bro, works well with MaxCDN. Does not work with Cloudflare

My Site, Tinhte.vn is working with cloudflare (check it: http://cdn.tinhte.vn/attachments/663478/).
I will work with you to see why?
Please answer my above question: Ah, you are using CloudFlare, in this case, Did you use A or CName for cdn.8thos.com?
 
Top Bottom