Blocks not showing - wrong src?

You need to be logged in to post messages in the forums. New users may register here.

Andreas Kaiser

Member since:
09 January 2008

Posts: 9

Tuesday 28 April 2009 10:12:54 am

Thanks for the great extension,

just trying to make it work with one project (with varnish). In this project I have one webserver with ez publish and a separate varnish server.

First the var/si-blocks/---.html files are being created ok.

The main problem is that the blocks are not being showed, perhaps because the src includes is like:

































eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Up

Jérôme Renard

Member since:
06 August 2008

Posts: 22

Tuesday 28 April 2009 11:00:33 am

Hi Andreas,






















































If ever you want to test, you can also use the SSI driver (BlockHandler=SSI) and let Apache's mod_include fetch si-blocks, it could be useful for testing, the needed configuration is described in the documentation file, in the following directory :
extension/ezsi/doc/


Best Regards.
Up

Andreas Kaiser

Member since:
09 January 2008

Posts: 9

Tuesday 28 April 2009 11:21:02 am

Thanks Jérôme for the fast answer... Now I really now how to proceed with my project...

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Up

Pablo Pernot

Member since:
09 January 2008

Posts: 17

Wednesday 06 January 2010 7:46:33 am

Hello Jérome. (salut !)

same question.
with the esi mode I generate a link which can't work var/si-blocks... as it is relative.

If -has indicated below- I use the SSI mode, ok it works, but I miss a step : where is varnish ? Ok the EZSI store the content, generate the static html file, and add the include in the html view, so apache mode_filter & mod_include include the html file (which has a right ./var/site-blocks... url).

So I obviously miss a step : where is varnish there ?
If I switched back to ESI Mode => varnish.
The link to the var/si-block won't work anymore.
What are the rules to put in the varnish vcl config ?

I noticed here :
http://varnish.projects.linpro.no/wiki/ESIfeatures
sub vcl_fetch {
if (req.url == "/test.html") {
esi; /* Do ESI processing */
set obj.ttl = 24 h;
} elseif (req.url == "/cgi-bin/date.cgi") {
set obj.ttl = 1m;
}
}

Ok I understand well that Varnish should only get the date.cgi but in our case the url is not working (again a relative url var/si-blocks). BTW I'm using URI siteaccess.
Thanks for you help, I'd like to quickly validate the Varnish / ESI team.
Thanks for your extension.

Up

Jérôme Renard

Member since:
06 August 2008

Posts: 22

Tuesday 12 January 2010 4:34:49 am

Hi Pablo,

not sure I understand your question but I'll try to answer :)



















































































Up

Valentin Doroschuk

Member since:
09 January 2008

Posts: 3

Monday 15 February 2010 6:03:46 am

Hi,
I'm trying to install Varnish and eZSI and could not get it work due to I use MathOrder=uri
and Varnish everytime tries to fetch si blocks using siteaccess
like http://host.com/siteaccess/var/si-blocks/....

This hack resolves it.






































Up

Pablo Pernot

Member since:
09 January 2008

Posts: 17

Thursday 25 February 2010 10:05:22 am

Thanks Jérome.

I damned, I copy/paste your doc... please change the "tll" to "ttl" in the example ... ###!:p
there :
{si-block key=string $key [tll=integer $ttl]}
Up

Pablo Pernot

Member since:
09 January 2008

Posts: 17

Tuesday 09 March 2010 1:04:13 am

I want to let you know that I needed to unload mod_deflate to make it works
as noticed here : http://www.mail-archive.com/varnish-misc@projects.linpro.no/msg02586.html

bye
Up

Alexandre Nion

Member since:
09 January 2008

Posts: 5

Wednesday 21 April 2010 3:30:44 am

Hi,

I do not think it is a problem to have relative path in your ESI src="" attribute. As long as the file is accessible directly by your browser it should be fetched by Varnish as well. If for example, from your browser you can access http://example.com/./path/../to/../file.html then Varnish should be able to access the file as well.


Indeed it may be..

As defined in ESI specs :
Relative URIs will be resolved relative to the template.


eZ Publish handles url aliases but as all requests are managed on web root (via index.php redirection), the real interpretation path remains "/".
But for Varnish, a slash in url constitutes a new "subfolder" that makes it a new home to be relative to.

Then when you play with pathes deeper than one level, the created esi request will be erraneous as it considers the last slash as a basis path.
For an ESI block called from a page named "http://example.com/Folder/Subfolder/The-final-content", that kind of uri will be produced : http://example.com/Folder/Subfolder/var/si-blocks/file.htm , which won't be a valid one.

Possible workarounds I see :
- Hack the FS handler in ezsiblockfunction.php to make the generated "src" absolute from "/" (Valentin's solution)
- Add an Apache rewrite rule to strip the folder path from the ESI request, rewriting them relative to "/" (not very smart..)
- Add a dedicated rule in Varnish VCL, to reconsider the base path before parsing esi tags :
# Parsing ESI tags
set bereq.url = "/";
esi;

But currently it doesn't seem to me possible to use the FS handler in a host configuration context without one of those workarounds?

And right with mod_deflate, I've also lost a few hairs with it... thanks Pablo to point it!
Up

You need to be logged in to post messages in the forums. New users may register here.