CSS file paths - what's the difference?


(Bdebroglio) #1
I'm sure there's a simple answer but it's eluding me. 
 
In the head of my page, when viewing source, I see one CSS file served from '_designs' and another from '/__data/assets'.
 
I want the latter, as '_designs' is blocked in robots.txt and Google is not seeing the responsive stylesheet (and showing issues with mobile usability).
 
GOOD
<link rel="stylesheet" type="text/css" href="http://www.mysite.tld/__data/assets/file/0081/92433/print.css?v=0.2.44" media="print" />

BAD

<link rel="stylesheet" type="text/css" href="http://www.mysite.tld/_designs/css/responsive.css" media="screen" />

?!


(Anthony) #2

I think you need to look at the static caching section of the CSS assets details screen.

Most of the "file" asset types in Squiz that will typically represent content that is served up repeatedly unchanged (i.e. has no dynamic elements in its rendering) have an option to allow them to be served directly by the web server from the __data folders to lighten the load on Squiz itself. Of course the assets also have to be live  and have public security permissions.


(Tim Davison) #3

For the file to be served from __data it needs to be public read and live (and allowed to be served from static location, which is the default).  

 

This will only work for CSS File assets.  If you are using a CSS Design then it will never be served from __data location.


(Nic Hubbard) #4

This will only work for CSS File assets.  If you are using a CSS Design then it will never be served from __data location.

 

This isn't correct. If you use the "Use Static Cache File?" option then the CSS Design File WILL be served using a __data URL. Obviously as long as it is live and has Public User read.


(Bart Banda) #5

 

This isn't correct. If you use the "Use Static Cache File?" option then the CSS Design File WILL be served using a __data URL. Obviously as long as it is live and has Public User read.

 

Only if you link to it using mysource_files in the parse file, or if you directly link to the separate static css file asset ID. If you still link to the CSS Design Asset using ,/?a= or %globals_asset_url:1234%, it will always use the design file, never the static file. 


(Tim Davison) #6

That's interesting Nic.  I've always avoided CSS Designs like the plague because of poor performance, even the manuals say to avoid them, but I would probably have linked them the wrong or unintended way.  Would be interesting to see how they perform if linked as you say.

 

Personally, I'm hanging out for us to upgrade so I can my hands on the CSS and JS File Folder assets.


(Bdebroglio) #7

Thanks all for your help - appreciated. Like Tim, also keen on the CSS and JS File Folder asset.


(Tim Davison) #8

Ok - I finally got my hands on a Matrix version that has CSS File Folders - and it's not working with CSS Designs.  When I go to link a CSS Design under the CSS File Folder it's greyed out - not possible (I'm using the details screen, trying to do 'Change + Use Me').

 

UPDATE: Ok - seems to a be a version issue.  Matrix v4.18 I'm not able to use CSS Designm Files with the CSS File Folder, but trying it on v5.1 I can.  Anyone able to confirm that's correct?


(Peter McLeod) #9

Hi Bern

 

Could you just modify you robots.txt file to disallow the designs directory, but allow indexing of a subfolder, such as where the css designs are... eg something like:

 

Disallow: /*_designs Allow: /_designs/css

 

This is the method we used when google Stopped adding the 'Mobile-friendly' label to search results for our site.

 

Peter