Hello

on the Tracking-Code for piwik is the compression not active.

That is the right code :

<!-- Piwik --> <script type="text/javascript">
2	var _paq = _paq || [];
3	(function(){ var u=(("https:" == document.location.protocol) ? "https://{$PIWIK_URL}/" : "http://{$PIWIK_URL}/");
4	_paq.push(['setSiteId', {$IDSITE}]);
5	_paq.push(['setTrackerUrl', u+'js/']);
6	_paq.push(['trackPageView']);
7	_paq.push(['enableLinkTracking']);
8	var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'js/';
9	s.parentNode.insertBefore(g,s); })();
10	 </script>
11	<!-- End Piwik Code -->

cange piwik.js to .js ony, after g.async=true;g.src= (at the end of the code)

The the compression works and all have one point more at the google pagespeed test.

Information at :
German Only sorry.

http://www.smart-webentwicklung.de/2012/05/piwik-asynchrones-tracking-ca...
http://www.itfoo.de/web/piwikjs-komprimiert-uebertragen/

You can see the Problem at https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2... at my webside.

Comments

drupal fan0815’s picture

Issue summary: View changes
hass’s picture

Version: 7.x-2.6 » 7.x-2.x-dev

No patch attached. Cases without proper patch and tests will be closed 14 days after opened.

drupal fan0815’s picture

??
I not understand.
The tracking code must be changed that the piwik.js can be compressed.
Then the Webpage can be faster loading.

With the newest Beta version the same Problem.

hass’s picture

Category: Feature request » Support request
Status: Active » Fixed

Above is not required at all. My servers always sends Last-modified and Etag and GZIP. There is nothing extra required to do this except a proper webserver configuration. Additional I do not think it's a good idea to run every request through PHP as this will cause extreme high CPU compared to a static piwik.js file that is already minified. Conditional-GET should also work with static files as Etag and Last-Modified has been send by the webserver.

You may better write in German... it may easier to understand. :-)

hass’s picture

Title: Tracking-Code compress piwik.js is not active » Tracking-Code compression of piwik.js is not active
hass’s picture

Title: Tracking-Code compression of piwik.js is not active » Tracking-Code compression of piwik.js may not active
drupal fan0815’s picture

Ja mein Deutsch ist besser.
Also meinen sie das man es nicht wie oben beschrieben machen sollte weil das zu viel CPU Last verursacht.
Und wie ich es weiter verstehe sollte also das komprimiern der Server selber machen über die Server config.
Verstehe ich das richtig mein Englisch ist so..

Da ich ein Webhosting Paket nutze müste ich mich also an den Webhoster wenden.

C-Logemann’s picture

In den zitierten Lösungen gibt es ein Beispiel, den Javascript Code selbst per PHP auszuliefern. Das ist eine Strategie, von der ich aus Performance-Gründen auch abraten würde. Alles, was ein Webserver effizienter als eine PHP-Anwendung (Drupal, eingeschlossen) machen kann, sollte auch von diesem erledigt werden.

Da ich ein Webhosting Paket nutze müste ich mich also an den Webhoster wenden.

Wenn das Problem hier in der Server-Konfig liegt dann schon. Managed Webhosting-Pakte beruhen zur Kostenreduktion aber auf einer Vereinheitlichung von Konfigurationen und sind somit von Haus aus unflexibel. Eine Nachfrage macht aber trotzdem Sinn aber auch ein Wechsel des Webhosting-Paktes oder gar des Providers auch, wenn das Webhosting-Paket nicht die Bedürfnisse deckt.


Short english summary:
#7 there is a question about the php strategy as a performance problem and I answer that it's always better to use a webserver for tasks he can do better than the php web application including drupal.
Additionally @drupal fan0815 is asking if this a server configuration task for his provider. I agree with this but managend hosting is not very flexible.
hass’s picture

All stuff required should be a .htaccess with the required rules/settings. Cannot remember that i ever configured something for piwik. Etag and last modified should default in apache. Gzip if deflate module is enabled. Very simple apache config. If you need help I can offer payed support. But I cannot help if the posting packet does not support these features.

drupal fan0815’s picture

All ok Thank you hass and C_Logemann.
The Support of my hosting is very good.
At first i have put out the Nginx for .js.
Well the Apache compression works fine.

My google page speed is after the fix by 80 / 100.

Danke euch beiden.
Der Support von meinem Anbieter ist sehr gut. Es ist jemand der Informaik Studiert hat der sich Selbständig gemacht hat.
Er macht alles was möglich ist. Und das macht er auch sehr schnell.
Also nicht so wie bei manchen riesen Anbietern.
Ich habe ihn schon angeschrieben.
Alles kann er aber auch nicht ändern da das Web Control Panel halt keinen offenen quellcode hat.

Mein Problem habe ich erstmal so gelöst das ich beim Nginx die .js Daten ausgeschlossen habe. Die bearbeitet jetzt der Apache und dort geht halt die Komprimierung.

Nginx ist in Plesk noch nicht ganz so gut integriert.

Warum ich halt erst hier gefragt hatte war weil mir aufgrund das meine Seite nicht so große Besucherzahlen hat das Lastproblem durch das ausführen von PHP nicht in den Sin gekommen ist.

hass’s picture

Nginx kann aber auch gzip... Und den rest natürlich auch. Plesk ist der letzte Dreck... genauso wie alle anderen dieser komischen tools die immer komische sachen machen, die man nicht erwartet oder einem eine manuelle config zerballert. Besser man weiss was man tut. Dann hat man immer die volle kontrolle.

drupal fan0815’s picture

Ja schon aber was soll ein hoster machen ?
Die Kunden müssen ja einiges einstellen können.

hass’s picture

Kein us unternehmen sein, die hardware, usv, notstrom diesel, klima, raum, reparaturservice, aktuelle os images und internet access bereitstellen. Das ist für die meissten schon zu viel verlangt...

hass’s picture

Assigned: drupal fan0815 » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.