Cookie-less domain for storage directory

Author Message

Rebecca Denham

Thursday 24 June 2010 8:14:59 am

Hello,

I am currently using ez 4.30 on Ubuntu 10.04. I would like to have the accesses to the storage directory to be via a cookie-less domain. So for example, if my eZ domain is www.example.com, all content would be served from this domain. But within eZ, I would like to specify that all references to images and other storage items be served from another domain. Is this possible?

Gaetano Giunta

Thursday 24 June 2010 9:11:52 am

1- You could create a new template operator that returns the hostname used for accessing design elements, and use it like this:

<img src="{imagehost()}{'myimage'|ezimage(no)}"/>

the downside of this approach is that it only work for new templates, not all the existing ones

1b- the same could be done with a single new template operator

<img src="{'myimage'|myezimage(no)}"/>

2- you could alter the existing ezdesign() and ezimage() template operators, but, afaict, that would be considered a 'hack' as there is no support to rewrite existing template operators except swapping the php class that implement them via the autoload mechanism

3- using a filter that is run on the complete page html after template rendering (look at xrowcdn extension for an example)

Principal Consultant International Business
Member of the Community Project Board

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:54:22
Script start
Timing: Jan 18 2025 10:54:22
Module start 'layout'
Timing: Jan 18 2025 10:54:22
Module start 'content'
Timing: Jan 18 2025 10:54:24
Module end 'content'
Timing: Jan 18 2025 10:54:24
Script end

Main resources:

Total runtime1.9214 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.1641152.6406
Module start 'layout' 0.00720.0039 741.804739.4766
Module start 'content' 0.01111.9086 781.2813521.3125
Module end 'content' 1.91980.0016 1,302.59388.1250
Script end 1.9214  1,310.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.1927160.0002
Check MTime0.00160.0822160.0001
Mysql Total
Database connection0.00150.076810.0015
Mysqli_queries1.871897.4180540.0347
Looping result0.00060.0288520.0000
Template Total1.882598.020.9413
Template load0.00190.099820.0010
Template processing1.880697.874920.9403
Template load and register function0.00020.012110.0002
states
state_id_array0.00220.115510.0022
state_identifier_array0.00170.086020.0008
Override
Cache load0.00160.0816140.0001
Sytem overhead
Fetch class attribute can translate value0.00110.056720.0005
Fetch class attribute name0.00210.110630.0007
XML
Image XML parsing0.00180.092320.0009
class_abstraction
Instantiating content class attribute0.00000.000530.0000
General
dbfile0.00280.1442160.0002
String conversion0.00000.000440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 7
 Number of unique templates used: 5

Time used to render debug report: 0.0003 secs