Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
LDDG Posted April 2, 2017 Posted April 2, 2017 Ok, so I finally got static.losdurosdelgenero.com working and serving as a CDN for all my static contect such as CCS, JS, themes, etc.. GTMetrix is still saying that static.losdurosdelgenero.com is NOT a cookie-less server. I am guessing that my setup is serving cookies to everything across my losdurosdelgenero.com domain. How can I setup my IPS so that only www.losdurosdelgenero.com has cookies and static.losdurosdelgenero.com is cookie-less?
Colonel_mortis Posted April 2, 2017 Posted April 2, 2017 It isn't IPS cookies that are being sent to your static subdomain, it's cloudflare and google analytics cookies. Cloudflare cookies are mandatory, but won't have a significant impact on page load times. Google analytics cookies can have the domain set by adding _gaq.push(['_setDomainName', 'www.losdurosdelgenero.com']); just before the </script> in the google analytics code that you pasted into ACP. On an unrelated note, you probably want to turn off directory indices within your apache settings for the static subdomain, because the root is showing the directory structure.
LDDG Posted April 2, 2017 Author Posted April 2, 2017 Hi @Colonel_mortis! Oh ok, so being that I am using Cloudflare, I should remove the cookie_domain entry I had set in the constants.php file? I had entered a cookie domain of www.losdurosdelgenero.com but I guess it doesn't matter with Cloudflare in the mix. Should I remove that entry? As for the directoy indices, do I need to set an htaccess file and place it in the static folder? How I go about turning off the directory indices? On a sidenote, being that I use Cloudflare, there really isn't any need to have all static files in the static.losdurosdelgenero.com subdomain? It doesn't really make any difference?
Colonel_mortis Posted April 2, 2017 Posted April 2, 2017 4 minutes ago, LDDG said: Hi @Colonel_mortis! Oh ok, so being that I am using Cloudflare, I should remove the cookie_domain entry I had set in the constants.php file? I had entered a cookie domain of www.losdurosdelgenero.com but I guess it doesn't matter with Cloudflare in the mix. Should I remove that entry? As for the directoy indices, do I need to set an htaccess file and place it in the static folder? How I go about turning off the directory indices? On a sidenote, being that I use Cloudflare, there really isn't any need to have all static files in the static.losdurosdelgenero.com subdomain? It doesn't really make any difference? Just because cloudflare sets a cookie, doesn't mean that there aren't benefits of getting rid of the other cookies. Some of the IPS cookies are quite large, especially admin-specific ones, so you still have a lot to gain from using a "cookie-free" domain, even if it isn't 100% cookie free. That said, you don't actually need the cookie_domain entry in constants.php, because it has a sensible default value, so the cookies won't be sent to other subdomains. Having it defined shouldn't cause any issues (unless you change domains and forget to change the value then), but it also doesn't provide any benefits. For the directory index, a .htaccess file with Options -Indexes should fix it, but I'm not certain because I've not used apache for a bit. If there is already a htaccess file, add anywhere (doesn't matter if there are other Options directives).
LDDG Posted April 3, 2017 Author Posted April 3, 2017 @Colonel_mortis I went ahead and added the entry to the htaccess file within the static folder. Can you verify if that issue with the directory indices has been corrected from your end? As for the cookies, I will continue to use the static.losdurosdelgenero.com domain then to serve all files even though I have Cloudflare. Quick question though... Should I set ALL folders on the files page within settings, to point to the static subdomain? I currently have everything set to it, except attachments. Should I also set attachments to that subdomain?
Colonel_mortis Posted April 3, 2017 Posted April 3, 2017 11 hours ago, LDDG said: @Colonel_mortis I went ahead and added the entry to the htaccess file within the static folder. Can you verify if that issue with the directory indices has been corrected from your end? As for the cookies, I will continue to use the static.losdurosdelgenero.com domain then to serve all files even though I have Cloudflare. Quick question though... Should I set ALL folders on the files page within settings, to point to the static subdomain? I currently have everything set to it, except attachments. Should I also set attachments to that subdomain? The index looks like it has been removed correctly. I would recommend putting attachments on the cookie-free domain too.
LDDG Posted April 3, 2017 Author Posted April 3, 2017 Working like a charm now! Thanks @Colonel_mortis!!!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.