Specific HTTP header

Author Message

Maxime Thomas

Tuesday 12 October 2010 5:13:36 am

Hi community,

My need is the following : I'm developping an extra layer on top of eZPublish and I have to get extra http headers from it without modifying the actual content.
How can I enforce eZPublish to set specific http headers without touching the kernel or developping an extra heavy extension ?

I've found some Cache-Control and other things in the site.ini but it not seems to be a generic mecanism.

Any help will do it.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Ivo Lukac

Tuesday 12 October 2010 5:42:59 am

Hi,

You should be able to do this in [HTTPHeaderSettings] in site.ini. Just add your header in HeaderList[] and specify it with your_header[]

Don't forget to enable CustomHeader there too

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Gaetano Giunta

Tuesday 12 October 2010 6:09:39 am

If you need the editors / the content to be able to set the source of those headers, use the persistent_variable:

. node template sets the desired header in the persistent var

. pagelayout tpl uses a custom template operator to send the header if it finds it in $module_result.persistent_variable

Principal Consultant International Business
Member of the Community Project Board

Maxime Thomas

Tuesday 12 October 2010 9:49:09 am

Thank you, I will try this one tomorrow.

And of course for the persistent_variable.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Maxime Thomas

Wednesday 13 October 2010 6:25:26 am

Yes it works.

[HTTPHeaderSettings] CustomHeader=enabled 
HeaderList[] HeaderList[]=Content-type 
Content-type[]
Content-type[/]=blabla

Gracias.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

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 00:52:53
Script start
Timing: Jan 18 2025 00:52:53
Module start 'layout'
Timing: Jan 18 2025 00:52:53
Module start 'content'
Timing: Jan 18 2025 00:52:54
Module end 'content'
Timing: Jan 18 2025 00:52:54
Script end

Main resources:

Total runtime0.9731 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.9297152.6094
Module start 'layout' 0.00710.0033 741.539139.4219
Module start 'content' 0.01040.9609 780.9609613.3203
Module end 'content' 0.97140.0017 1,394.281316.1875
Script end 0.9731  1,410.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3541160.0002
Check MTime0.00140.1445160.0001
Mysql Total
Database connection0.00120.118310.0012
Mysqli_queries0.910593.5725650.0140
Looping result0.00070.0739630.0000
Template Total0.938796.520.4693
Template load0.00240.248520.0012
Template processing0.936396.214820.4681
Template load and register function0.00010.011010.0001
states
state_id_array0.00080.085510.0008
state_identifier_array0.00160.165820.0008
Override
Cache load0.00190.1922280.0001
Sytem overhead
Fetch class attribute can translate value0.00050.055630.0002
Fetch class attribute name0.00120.125480.0002
XML
Image XML parsing0.00150.157030.0005
class_abstraction
Instantiating content class attribute0.00000.0021100.0000
General
dbfile0.00120.1194290.0000
String conversion0.00000.000940.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs