Search the Community
Showing results for tags 'procache'.
-
The Page Hit Counter module for ProcessWire implements a simple page view counter in backend. Page views of visitors are automatically tracked on defined templates, with monitoring of multiple page views. This gives you a quick overview of how many visitors have read a news or a blog post, for example, without first having to open complex tools such as Google Analytics. This module quickly provides simple information, e.g. for editors. Or, for example, to sort certain news by most page views. For example for "Trending Topics". Works with ProCache and AdBlockers. With a lightweight tracking code of only ~320 bytes (gzipped). And no code changes necessary! In addition GDPR compliant, since no personal data or IP addresses are stored. Only session cookies are stored without information. In addition, there are some options, for example filtering IP addresses (for CronJobs) and filtering bots, spiders and crawlers. You can also configure the lifetime of the session cookies. Repeated page views are not counted during this period. It is also possible to exclude certain roles from tracking. For example, logged in editors who work on a page are not counted as page views. Sort by hits and access page views (hit value) Each trackable template has an additional field called phits. For example, you want to output all news sorted by the number of page views. // It is assumed that the template, e.g. with the name "news", has been configured for tracking. $news = $pages->find("template=news, sort=-phits"); To output the page views of a tracked page, use: echo $page->phits; Example: Reset counter per API $modules->get("PageHitCounter")->resetPageViews("template=whatever", false); Example: Tracking a page hit via API and jQuery If you want to track a template that does not represent a full page to automatically inject a tracking script, you can define allowed API templates in the module that you can track. Below is an example of how you can track a click on news tag using jQuery. This will allow you to find out which keywords are clicked the most. For example, you can sort and display a tag cloud by the number of hits. Suppose your keywords have the template "news_tag". The template "news_tag" was also configured in the Page Hit Counter Module as a trackable API template. Example PHP output of keywords / tags: // Required: the data attribute "data-pid" with the ID of the template to be tracked. echo $pages->find("template=news_tag, sort=-phits")->each("<a href='{url}' class='news_tag' data-pid='{id}'>{title}</a>"); Example Tracking Script with jQuery: /** * Required: Data attribute "data-pid" with the ID of the news tag template * Required: Send the POST request to the URL "location.pathname.replace(/\/?$/, '/') + 'phcv1'" * Required: The POST parameter "pid" with the ID of the template */ $(function(){ if($('a.news_tag').length > 0) { $('a.news_tag').each(function(){ var tPID = $(this).data("pid"); if(tPID) { $(this).on("click", function(){ $.post(location.pathname.replace(/\/?$/, '/') + 'phcv1', {pid: tPID}); }); } }); } }); So simply every click on a tag is counted. Including all checks as for automatic tracking. Like Bot Filtering, Session Lifetime, etc. Notice: Tracking with URL segments If the option "Allow URL Segments" is activated on a template, the hits are only counted if the base URL of the page is called. If you want the hit to be counted even when a segment is requested, you MUST configure the segments in the template configuration. How to do this can be found here. If you use dynamic segments, configure them as RegEx. There is currently no other option. The problem is that the Page Hit Counter hooked into the PageNotFound process. If URL segments are allowed but not defined, a 404 is never triggered. This means that the Page Hit Counter cannot be called. New since 2.0.0: Ignore URL segments If a template has URL segments configured, each hit on a different segment is counted as a new hit. Enable "Ignore URL segments" so that dynamic segments are not counted individually on the base template / page. New since 2.0.0: Use cookieless tracking (Experimental) Enable this option to not use individual cookies for tracking or if you have many different pages you want to track. The limit for cookies is 50 per domain for all cookies on the page. If the option is enabled, PHP session storage is used. Downside: you can't set the lifetime higher than configured in your PHP.ini and the session will be terminated as soon as the browser is closed. Upgrade note for 2.0.0 from previous versions! Version 2.0.0 requires an update in the database schema, so that additionally the date of the last access / hit on the page can be displayed ($page->lastPageHit). To make this possible, you have to do the update via the upgrade module, upload the ZIP itself and do an update directly via the backend AND DO A MODULE REFRESH DIRECTLY AFTER UPLOAD/UPDATE. If you do not do this, you will get an error that a column is missing in the database table. _______________________________________________________ Background: This module is the result of a customer requirement, where the editors are overwhelmed with analytics or no tracking tools were allowed to be used. However, a way had to be found to at least count page views in a simple form for evaluations. Furthermore, by using ProCache, a way had to be found to count views of a page without clearing the cache. _______________________________________________________ Pros Automatic Page View Tracking Lightweight tracking code, only ~320 bytes (gzipped) No code or frontend changes necessary Works with ProCache! Even if no PHP is executed on the cached page, the tracking works Works with browser AdBlockers No cache triggers (for example, ProCache) are triggered. The cache remains persistent GDPR compliant, session-based cookie only, no personal information Filtering of IPs and bots possible Exclude certain roles from tracking Ability to reset Page Views Works with all admin themes Counter database is created as write-optimized InnoDB API to track events for templates that are not viewable No dependencies on libraries, pure VanillaJS (Automatic tracking script) Works in all modern browsers Pages are sortable by hits Cons Only for ProcessWire version 3.0.80 or higher (Requires wireCount()) Only for PHP version 5.6.x or higher No support for Internet Explorer <= version 9 (Because of XMLHttpRequest()) No historical data, just simple summation (Because of GDPR) Segment URLs can only be counted if the segments are defined Planned Features / ToDos API access to hit values Since version 1.2.1 Possibility to sort the pages by hits (Request by @Zeka) Since version 1.2.0 Don't track logged in users with certain roles (Request by @wbmnfktr) Since version 1.1.0 Possibility to reset the counter for certain pages or templates (Request by @wbmnfktr) Since version 1.1.0 Better bot filter Since version 1.1.0 Disable session lifetime, don't store cookies to track every page view (Request by @matjazp) Since version 1.2.1 Option to hide the counter in the page tree (Request by @matjazp) Since version 1.2.1 Option to hide the counter in the page tree on certain templates Since version 1.2.1 API to track events for templates that are not viewable Since version 1.2.2 Cookieless tracking Since version 2.0.0 Show last hit Since version 2.0.0 Ignore URL segments (Request by @bernhard) Since version 2.0.0 Add hookable method after pageview was tracked (Request by @bernhard) Since version 2.0.0 Changelog 2.0.0 Feature request: Add hookable method after pageview was tracked (___pageViewTracked($pageID)) (Requested by @bernhard) Feature request: Ignore URL segments option (Requested by @bernhard) New: Cookieless tracking New: Show date of last hit Update: Botlist Enhancement: Documentation improvement 1.2.7 Feature request: make buildPageListHitCounter-Function public (Requested by @bernhard) 1.2.6 Bug-Fix: Set the counter of a cloned page to 0 Enhancement: The function for resetting counters is now available in the module as a public function to reset counters via own scripts on the API side (Request by @VeiJari) Enhancement: Documentation improvement API reset 1.2.5 Bug-Fix: When counting 404 hits, cookies are no longer set. The session lifetime is deactivated for the 404 page Enhancement: Documentation improvement regarding URL segments 1.2.4 Bug-Fix: Resetting the counters on system pages (e.g. 404) does not work (Reported by wbmnfktr) Bug-Fix: Tracking endpoint is logged as 404 if module "Jumplinks" is installed (Reported by wbmnfktr) Enhancement: Corrected few typos (Merged from Sergio #6 – THX!) 1.2.3 Bug-Fix: Tracking script triggers 404 if pages are configured without slash (#3) Reported by @maxf5 Enhancement: Reduction of the tracking script size if it's gzipped (~320 bytes) Enhancement: Documentation improvement Enhancement: Corrected few typos 1.2.2 New feature: API to track events for templates that are not viewable Enhancement: Documentation improvement 1.2.1 API access to hit values Use $page->phits Bug-Fix: No tracking on welcomepage (Reported by wbmnfktr; Thx to matjazp) Bug-Fix: Tracking script path on subfolders (Reported by matjazp) Bug-Fix: Tracking on pages with status "hidden" Enhancement: Change database engine to InnoDB for phits field Enhancement: Option to disable session lifetime set session lifetime to 0, no cookies Enhancement: Better installation check Enhancement: AJAX Request asyncron Enhancement: Reduction of the tracking script size by ~20% Enhancement: Option to hide the counter in the page tree You can output the counter with the field name "phits" Enhancement: Option to hide the counter in the page tree on certain templates Enhancement: Option for activate general IP validation Enhancement: Reduction of tracking overhead up to ~30ms Enhancement: Better bot list for detection 1.2.0 New feature: Sort pages by hits – New field phits Migrate old counter data to new field 1.1.0 New feature: Exclude tracking of certain roles New feature: Reset Page Views Better bot filter and detection 1.0.0 Initial release Notes By default, the page views are stored as INT in the database. This allows a maximum counter value of 4.2 billion views (4,294,967,295) per page. If you need more, change the type to BIGINT directly in the database. But I recommend to use Google Analytics or similar tools if you have such a large number of users. _______________________________________________________ Download GitHub: ProcessWire Page Hit Counter (Version 2.0.0) PW Module Directory: ProcessWire Page Hit Counter (Version 2.0.0) Install via ProcessWire (Classname): PageHitCounter _______________________________________________________ Update information If you have used version 1.2.1 from the DEV branch, please replace it completely with the new master version. Old stable version Download GitHub: ProcessWire Page Hit Counter (Version 1.2.7)
- 111 replies
-
- 22
-
- hitcounter
- tracking
- (and 4 more)
-
I hadn't developed a website for a while, but here we are. It's a very simple minimalist website to showcase the latest work of Dominican Artist Patricia Abreu Mota. Site: https://patriabreu.com Modules: Procache ❤️ Seo Maestro Profiler Pro Lister Pro ProcessRedirects
-
Hello, I am using ProCache v3.1.8 on ProcessWire 3.0.96. Everything worked fine in the past, but today I noticed that the css file serverd by procache gives a 410 error. The file is there, I checked. I deleted the cached files, I deleted the css file, I looked into the .htaccess file looking for some clues about this problem but nothing worked. The only way i can see my website correctly again is disabling ProCache. Has anyone any clue on what could be the cause of the problem or on what should I do to fix it? Thanks!
-
We want to install ProcessWire in 2 server layers In the first layer of servers is only to deliver the static content (css, js, image, html "ProCache"), without php installation the apache would be initialized in worker mode In the second layer of servers, php will be available, the work will be done to process all the requests of the pages that are not in ProCache and of the services that require php execution. The servers of the first layer would reach the servers of the second layer through a ProxyBalancer. My questions are: How can I take the configuration of .htaccess to virtualhost? The setting RewriteRule ^(.*)$ index.php?it=$1 [L,QSA] can be changed for RewriteRule ^(.*)$ proxybalancer://secondservers/index.php?it=$1 [L,QSA]
-
Hello, I'm started to play around with processwire. And I like it! My local dev system is up and runnig. I'm using the template factory with Twig. Anybody who use Twig and ProCache or is it possible to use both modules? Thanks in advance
-
json Plain JSON PHP file in a template with ProCache
Eunico Cornelius posted a topic in API & Templates
Hi, I am trying to create a PHP page in my website that is hidden and produce a plain JSON format. However, when I implement json_encode on my string, the result is not only a plain JSON but also a <!DOCTYPE HTML>.... I have created a new page and a new template that has it's cache disabled, but it still doesn't work. this is what my code looks like <?PHP $useMain=false; $data = "[{'title':'AAAAA','url':'https://google.com'}]"; header('Content-Type: application/json'); echo json_encode($data); ?> This is what I currently get "[{'title':'AAAAA','url':'https:\/\/google.com'}]"<!DOCTYPE html><html>....</html> This is what I am trying to achieve "[{'title':'AAAAA','url':'https:\/\/google.com'}]" What am I missing here? I am also using ProCache.(dont know if it has any influence since I created and disable cache in a new template) -
I developed my own web store platform on ProcessWire. Work like a charm. However, I would like to know what is the best way to cache web store? There is a shopping cart, many languages and previously watched products which need to run without cache but everything else could be cached. Is there a way to use PW's own cache or ProCache for everything else except for certain HTML ID? I have used MarkupCache for categories in some cases. I'm addicted to speed. Everything has to be loaded as fast as possible or even faster. My next step is developing AMP HTML as part of the platform, but that is not helping normal version.
-
The new Monitor Audio website is a ground up build featuring a completely custom front end design and back end Processwire build. Modules in use include Multi Language, ProCache, Blog, FormBuilder, Instagram and ProFields. The site has a large product catalogue, dealer finder and is in multiple languages. However, one of the main objectives for the project was to deliver a platform that could be easily edited and expanded as needs grow. The client team were involved at every stage. As developers we went a long way to make sure everything was editable. Other features include: IP controlled contact form with multiple email destinations based on enquiry type Product registration form with multi-product registration from a select group of products Company timeline with year filter all based on the blog platform Dealer finder with three dealer types and in multiple countries Newsletter signup with multiple signup opportunities (sign up box and other forms) FAQ section File downloads for products from internally (CMS) uploaded files or external file links There are also several other expansions and features planned. As always we'd love to hear your feedback on the site https://www.monitoraudio.com/
-
Has anyone come across this issue where Amazon Cloudfront seems to refuse to cache a certain small number of static objects? I've tried invaliding the cache (root path) several times to no avail. I had a look at the file permissions of the objects in question, and they seemed all ok. I've also gone into the Amazon Console and there are no errors logged. You can see more details of this here : http://www.webpagetest.org/performance_optimization.php?test=171106_A4_be80c122489ae6fabf5e2caadcac8123&run=1#use_of_cdn I recently upgraded this test site to PW 3.062 from PW 2.8.x and noticed this was happening. I'm also running the latest version of Procache on this site.
-
- amazon
- amazon cloudfront
-
(and 3 more)
Tagged with:
-
Seems like procache minify removes a trailing slash within embedded svg files tags ( path, polygon, rect etc ) It causes the svg not display correctly in Safari and Chrome. How do I force it to keep that slash? Thanks
-
Hi folks, We recently turned on ProCache and have noticed this happening when the homepage of the site is accessed: When you go to our homepage (as in, typed into an address bar -- oddly it doesn't happen with bookmarked pages), it results in this: https://www.villasofdistinction.com/site/assets/ProCache-5a95c48539bfade3888cb4c439f//index-www_villasofdistinction_com.html Of course, nothing should appear in the address but the "https://www.villasofdistinction.com/". Why does the rest, "site/assets/ProCache-5a95c48539bfade3888cb4c439f//index-www_villasofdistinction_com.html" appear? And what can be done to get rid of it? Thanks for any help - Happy Friday!
-
Hey! I've just installed ProCache which is awesome. I did notice though that my <body> tag was omitted in the minified HTML output. I managed to get the body to render by adding a class to it. Any else had this issue before? Andy
-
Hi, I'm running several speed tests for my personal site using http://webpagetest.org. My site has the ProCache module installed. The lifespan is set to 1 week, but I am not sure it is the same as the expire date seen in the following report : WebpageTest for guyverville.com. Setting Expire Headers can be done in .htaccess. I don't want to interfere with ProCache, but would like to understand what I can do here. Thanks
-
Hi guys, im thinking about purchasing ProCache module, but i dunno if it will be any good on my site http://hejtuje.com. Content on the site is added by users and its changing all the time. Would my site benefit from proCache or caching is just a bad idea for this type of site ? Please advice. Thanks!
-
Hi everyone, The new website of my company Omnitic is finally launched! Initially started in Wordpress, it was finally built on Processwire with Gumby Framework as i wanted a real use case to practice my "wiring". I must say that i'm pleased with the final result and how fast it was to get this up and running with Processwire. For a extra speed boost ProCache has also been used to make the overall experience as fast as possible : if you build website with Processwire and don't use this module, you're doing it wrong. There's still some tweaking to be done though (image optimization, some responsive issues to name a few) Regards and happy wiring. Nicolas
-
http://familleverville.org A new website made with PW. ProCache has been installed and it works like a charm. The site was previously built in Flash, so I kept the overall structure. This photo album stops at 2007, because the previous site was a built specially for the 50th wedding anniversary of my parents. It will be completed soon. Nothing fancy. Three level of pages, three templates. One extra field. Five sections which can be translated as: Ancestors, Jacques and Irène, The years, Anniversaries, Photo Index. Every photo has been tagged so they can populate the Photo Index section. My mother has her own website (http://irenegiguere.com), made also with PW. She is 75 and has adopted quite easily the CMS. She is eager to begin working the new site, along my sisters who are thrilled to help. Congratulations, Ryan, you've conceived a really great tool!