Jump to content

matjazp

Members
  • Posts

    686
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by matjazp

  1. Perhaps this: https://processwire.com/talk/topic/23613-search-for-page-id/ ?
  2. I already dig and found nothing. It never happened again.
  3. @Robin S thank you for this hook, it works like a charm. Its clear I'm in a hurry and don't have time to search the forum. It's also clear that you have much better memory than I do :-) @adrian thank you for the hint, currently I'm not using Tracy on this particular site and also users are editors.
  4. Is it possible to search for page ID in the search field (top right)? It looks like it only search for title (and other fields if configured) but not by ID...
  5. @kongondo thanks, will check
  6. Anyone have a module or some code to create short urls? Like user enters long url, enter start/stop date when short url is active, push submit and it gets short url back? There are url shorteners on the web, but would like to use PW. I thought about adding each url as page somewhere, then enabling url segments on home template, check if seg1 exist and make redirect. I'm sure I could do it, but I'm in hurry and planty other things to do, also don't want to reinvent the wheel...
  7. Thanks for the info. I pushed a fix (you don't have to reinstall).
  8. Never saw this error before. It comes from modules.php in ___saveConfig() method. I guess it has something to do with namespace as error states "\AllInOneMinify" as module name, but here on my local dev the module name is without "\". Please try attached version (it contains just .module file, simply replace it). AllInOneMinify.zip
  9. 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);
  10. 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
  11. 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).
  12. 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.
  13. It works. The Robin's fix is exactly what I recently used in one of my modules.
  14. Perhaps use "\n" instead of PHP_EOL?
  15. 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?
  16. 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.
  17. 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?
  18. 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).
  19. 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.
  20. 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).
  21. 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.
  22. @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).
  23. I've set up the template cashing on the Cashing tab, like 3600 seconds, for Guests only. When I access the page I can see that the cache file is created at /site/assets/cache/Page/ folder. On the next access of that page the content is served from the cache. What I observed is that the caching isn't really effective as my page render time is almost the same. I guess that if the page would be "heavier" the difference would be more significant. It looks like PW takes it's time to boot and there is where most of the time go. What are your observations? Also, when you edit the corresponding template file (aka basic-page.php) and made some changes, those changes are not reflected in the output until the cache expires or you edit and save the page with that template in admin. Can anyone confirm?
  24. My site is under "attack", this are the errors: User: ? Error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name '/../boot.ini........................................................................................' is too long (in \wire\core\WireDatabasePDO.php line 499) User: ? Error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1059 Identifier name '/../../../../../windows/win.ini.....................................................................' is too long (in \wire\core\WireDatabasePDO.php line 499) What to check? How to react? It's my first time :-)
×
×
  • Create New...