Announcement

Collapse
No announcement yet.

A MUST HAVE TWEAK! For any of you who use CDN to serve cached content

Collapse
X
Collapse
First Prev Next Last
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A MUST HAVE TWEAK! For any of you who use CDN to serve cached content

    I am posting here as for quite some time CDN functions ware totally neglected by VB5 staff.

    yeah it was there but it sucked / sux ... and it still do

    but i am talking back in 2013 when we started with vb5...
    CDN support back then was there ... BUT it was.....




    ammmmmmmmm.....anyway...
    now up to this date (nov 2016) things have improved ..
    but still even if you set your CDN URL
    + export all css and js not to be in the database but stored in actuall files


    then you will run in to this really f*ed up thing that still i cant get my head the way the vb staff responded...

    if you look in to
    Kevin Sours added a comment - 30/Jan/14 02:14 PM

    Should supply an alternate the htaccess optimized for the CDN
    so in simple words if you dont edit your .htaccess

    and set Header set Cache-Control

    from private to public

    You will end up like this then:



    X-CACHE:MISS and you are Fu*ked
    the CDN wont cache the CSS and JS


    in the end by using a CDN your VB will load slower because the CDN have to get that non cached file and then server it to you..




    VB5 staff?? why??


    there is a reason that vb official forums load slow AF.
    they dont even use CDN.. any at all...
    a company like VB should be able to afford akamai .. or any other high end cdn provider dont you think?

    ___________________________________



    Sooooooooo in case you use CDN

    edit your .htaccess

    FROM

    Code:
        <filesmatch "\.([B]css[/B])$">
            Header set Cache-Control "max-age=31536000, [B]private[/B]"
        </filesmatch>
        <filesmatch "\.([B]js[/B])$">
            Header set Cache-Control "max-age=1209600, [B]private[/B]"
        </filesmatch>

    TO



    Code:
    <IfModule mod_headers.c>
        Header set Connection keep-alive
        <filesmatch "\.(ico|flv|gif|swf|eot|woff|otf|ttf|svg)$">
            Header set Cache-Control "max-age=2592000, public"
        </filesmatch>
        <filesmatch "\.(jpg|jpeg|png)$">
            Header set Cache-Control "max-age=1209600, public"
        </filesmatch>
        <filesmatch "\.(eot|woff|otf|ttf|svg)$">
            Header set Cache-Control "max-age=2592000, public"
        </filesmatch>
        # css and js should use private for proxy caching https://developers.google.com/speed/docs/best-practices/caching#LeverageProxyCaching
        <filesmatch "\.([B]css[/B])$">
            Header set Cache-Control "max-age=31536000, [B]public[/B]"
        </filesmatch>
        <filesmatch "\.([B]js[/B])$">
            Header set Cache-Control "max-age=1209600, [B]public[/B]"
        </filesmatch>
    </IfModule>





    TA DAAAAAAAAAAAAAAAA

    Last edited by discoverxs; 11-22-2016, 06:59 PM.

    - Putting the XS back into lifeβ„’
    The first Pheromone Research community based on vBulletin Verion 5.x

    #2
    I'm using CloudFlare and I did that here in this forum. I edited the .htaccess to change private to public to get CF-Cache-Status: HIT on static css and js files. I don't know why the default htaccess supplied by vB uses private.
    Helpful? Donate. Thanks!
    Buy me a coffeePayPal QR Code
    Fast VPS Host for vBulletin:
    A2 Hosting & IONOS

    Comment


      #3
      I love these tweak sites. All hours of the night 24/7 there's always something to work on.

      Enjoy,
      William

      Comment


        #4
        Originally posted by glennrocksvb View Post
        I'm using CloudFlare and I did that here in this forum. I edited the .htaccess to change private to public to get CF-Cache-Status: HIT on static css and js files. I don't know why the default htaccess supplied by vB uses private.
        the only response i got was

        Kevin Sours added a comment - 29/Jan/14 02:54 PM

        This was a result of VBV-7379. There was no useful information there on why it was done, but the comments note:

        https://developers.google.com/speed/docs/best-practices/caching#LeverageProxyCaching

        This is recommended as a workaround for some broken proxy caches that can cause problems with JS and CSS. I see no evidence that this was done in response to an actual problem.

        - Putting the XS back into lifeβ„’
        The first Pheromone Research community based on vBulletin Verion 5.x

        Comment


          #5
          Hello glennrocksvb why i can't see the above code .
          I just see ((Users awaiting moderation or email confirmation and banned users are not allowed to view the code. ))
          i m already log in ! Thanks

          Comment


          • glennrocksvb
            glennrocksvb commented
            Editing a comment
            Try again and reload the page.

          #6
          Thank you now working well

          Comment


            #7
            I've tried logging in and out multiple times after confirming my account was confirmed... do you have user moderation on?

            edit: fixed, i just had to wait

            Comment


              #8
              OK, I'm going to live up to my user title, but how does one know if they are using CDN?

              Comment


                #9
                I did this yesterday and when I checked my cdn vs host requests, 99% were still going through my host :/

                Comment

                Users Viewing This Page

                Collapse

                There is 1 user viewing this forum topic.

                • Guest Guest

                Latest Posts

                Collapse

                Working...
                X
                Searching...Please wait.
                An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

                Please push the back button and reload the previous window.'
                An unexpected error was returned: 'Your submission could not be processed because the token has expired.

                Please push the back button and reload the previous window.'
                An internal error has occurred and the module cannot be displayed.
                There are no results that meet this criteria.
                Search Result for "|||"