Jump to content

matjazp

Members
  • Content Count

    577
  • Joined

  • Last visited

  • Days Won

    3

matjazp last won the day on March 11

matjazp had the most liked content!

Community Reputation

432 Excellent

1 Follower

About matjazp

  • Rank
    Hero Member
  • Birthday 04/27/1969

Profile Information

  • Gender
    Male
  • Location
    Maribor, Slovenia

Recent Profile Visitors

4,316 profile views
  1. This could be one of those weirdness pwired mentioned. Windows does not have fr_CA.UTF-8 locale. Please check this link: https://docs.moodle.org/dev/Table_of_locales Also be aware that the %e and %k modifiers are not supported in the Windows implementation of strftime() function. I use this on windows (found somewhere on the net): function mydate($f, $d) { $f = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $f); $f = preg_replace('#(?<!%)((?:%%)*)%k#', '\1%#H', $f); return iconv("", "UTF-8", @strftime($f, $d)); }; and the use it like this (old fashion way): if($lang === "en") $out .= "Publish date: " . mydate("%Y/%m/%d", $post->post_date); else $out .= "Datum objave: " . mydate("%e. %B %Y", $post->post_date);
  2. It could be frustrating and weird, as almost anything on the world... As I said, Apache can be installed if one is familiar with it
  3. As far as I know you don't have to use IIS, you can install apache, like XAMPP. But I can confirm PW will work on IIS as I'm on the same infrastructure as you are. I have a bit updated version of web.config here on my local test environment, but even web.config from 2016 should work. But you will need IIS rewrite module for sure. Let me know if I can assist further (like remote access via RDP or TW or anything).
  4. I think all caching "solutions" would somehow benefit with "warm-up" (you can try a new version of AIOM that mimics how ProCache works). Most crawlers do what you want to do more or less successfully (with some gotchas you and Horst mentioned), but it would certainly look more "professional" and it would be integrated into PW.
  5. It works. The Robin's fix is exactly what I recently used in one of my modules.
  6. Perhaps use "\n" instead of PHP_EOL?
  7. This is exactly what I'm doing, but in PHP, check cache() method in AIOMcache.php. I know .htaccess rules, Ryan sent them to me 4 years ago when I was tempted to buy ProCache, but since I'm on IIS he couldn't confirm if it would work. But this is all I know about ProCache, I learned everything else from the documentation pages and I don't know if there is anything else to consider. I use zend opcache on my sites and this helps a lot, they are fast enough so I might not need ProCache or AIOM+ cache, but it's something that I always wanted to try and never had time or will to do it. Now I did it and released it in public, perhaps someone finds it useful or maybe something similar can be part of the core and we all win. Hm, then ProCache wouldn't be needed?
  8. Yeah, that's the point here. I don't have enough knowledge about the boot process and all this (I'm just a hobby user). What I would be interested in if someone with ProCache would explain how it works and how ProCache knows all that details if PW (or even) php isn't touched at all? I assume it takes all of this into an account and creates a cache file only if those conditions are met? I simply ignore all POST requests, all GET requests (other than paginations - I didn't test with segments, hmm...), ignoring logged users. I wanted to be sure that I don't echo something I shouldn't so this was the easiest and possibly the safest way to go... I mentioned that to Ryan in PM (he contacted me in regards to recent hacking attempts), but he ignored my idea. Or perhaps he didn't read to the end of my message? Or he likes my approach but has no time to implement it (I just asked for a way to include some script before PW starts)? Or maybe he is working on it??? I wouldn't count on him, he has more important things to do, I guess, like fixing issues that bothers a lot of users for quite some time or even accepting some of the 278 feature requests :-) I guess I won't have time for programming for at least for a week or two (you know, covid-19), will see. I started this as addon to AIOM, then separated it, then merged it again with AIOM+ as template caching might interfere with the HTML minimizing option in AIOM+ and decided it would be best if I have control in one module.
  9. The inefficiency I noticed was that the render time (I just use Chrome console with disabled caching, monitoring the Time column) with enabled or disabled template cache was almost the same. I used just a simple template file with the echo "foo"; in it. Then I read about ProCache and learned that it delivers cached pages directly from the disk without even touching the php. I tried this approach on Windows with IIS but the URL rewrite module complained about some caching issues, so I ditched this approach (this is likely IIS issue). Then I tried with php echoing the file from the disk and it worked. I looked at the source code of some core files and discovered that cached pages are actually already there on the disk, but it takes time before PW reaches them: it has to go through the boot process, load/include all the modules/files, etc. and that process takes time. So the module creates its own AIOM+ cache files based on page URLs/names with information about the actual page cache file and its expiration. I check this AIOM+ cache file, load the content and echo it. That process takes between 5 and 10 ms on my computer, while "full" load time is between 300 and 350 ms, and with cache like 300-320 ms. I'm not sure this is a good way to go. My biggest concern is if this is safe? I assume ProCache does it similarly?
  10. I updated my forked version of AIOM+ to 4.0.0 https://github.com/matjazpotocnik/ProcessWire-AIOM-All-In-One-Minify It adds "AIOM+ template caching" :-) My tests shows noticeable improvements in render times, dropping from like 300 ms (on localhost) to 10 ms. I guess ProCache would be even faster (don't have it, can't test). If anyone wanna try this early alpha version, please read README.md (must read).
  11. matjazp

    Hacking attempts

    I know it was a bot and I know the originating IP. I blocked IP and agent string and then it stopped. Why/how it happened is unknown. That is, I know it was GET and not POST request, I know the querystring but I wasn't able to duplicate the error.
  12. This also came to my mind. Although it could be considered as unexpected result even if you don't have includes and the page is not updated when you update the template file... I'm testing on localhost, SSD disk, for simple echo "foo" in my template file it takes cca 300 ms in Chrome network panel (Chrome caching disabled).
  13. As guest in incognito.
  14. I am using opcache built in php on windows/IIS and it helps a lot. I don't have a problem with the speed of my sites, I'm just brainstorming- wondering why caching doesn't help that much as I expected. But I'm working on my own caching solution and results so far are very good.
  15. @MoritzLostThanks for confirming that. I guess there must be some reason for that? As PageRender could take this into an account. @draganThanks for the hint. What is the difference between the MarkupCache module and https://processwire.com/api/ref/wire-cache/? Still, this is something developer should do, it's not on/off solution (and to be fair, template cache would probably also not be good solution for just every template).
×
×
  • Create New...