Jump to content

Search the Community

Showing results for tags 'optimization'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 3 results

  1. Hey, so we all know about SEO and the importance of performance. Basically we do it, because if no one finds the website we just built, it´s frustrating. We all try to write clean markup, css and js code and most might have a webpack/gulp/whatever pipeline to minimize css&js. But when thinking about it, optimizing your pipeline might save you a few (hundreds) of kb, compared to loading an image with 1 mb that´s literally nothing and frankly just ridiculous. Don´t get me wrong, frontend pipelines are great and should be used, but let´s shift your "I will optimize the shit out of that 3 css lines" focus to something different: try to serve images as fast as possible, this is where the performance boost really happens. I´m no pro on processwire so far, but I built a very easy to use picture element, which some of you could find interesting: 1. the picture comes with 3 different sizes: one for mobile (keep in mind the double dpi, therefore width of 828px), one for tablet and one for desktop 2. the picture generates a webp version and the original file extension as a fallback 3. the filesize of each element is rendered within the "data" attribute 4. lazy loading(sooo important!!!) is done via the native 'loading="lazy"' attribute. Please try it out and see the difference ? I posted this so others can easily optimize their images, but I would also like to hear your suggestions in making it better. Maybe you could decrease the rendering time or maybe you have some easy improvements. Please let me know. Greetings from Austria! <picture> <source data="<?php echo($oElement->repeater_image->width(828)->webp->filesize);?>" media="(max-width: 414px)" srcset="<?php echo($oElement->repeater_image->width(828)->webp->url) ?> 2x" type="image/webp"> <source data="<?php echo($oElement->repeater_image->width(828)->filesize) ?>" media="(max-width: 414px)" srcset="<?php echo($oElement->repeater_image->width(828)->url) ?> 2x" type="image/<?php echo($oElement->repeater_image->ext)?>"> <source data="<?php echo($oElement->repeater_image->width(767)->webp->filesize) ?>" media="(min-width: 415) and (max-width: 767px)" srcset="<?php echo($oElement->repeater_image->width(767)->webp->url) ?> 2x" type="image/webp"> <source data="<?php echo($oElement->repeater_image->width(767)->filesize) ?>" media="(min-width: 415) and (max-width: 767px)" srcset="<?php echo($oElement->repeater_image->width(767)->url) ?> 2x" type="image/<?php echo($oElement->repeater_image->ext)?>"> <source data="<?php echo($oElement->repeater_image->webp->filesize) ?>" media="(min-width: 768px)" srcset="<?php echo($oElement->repeater_image->webp->url) ?>" type="image/webp"> <source data="<?php echo($oElement->repeater_image->filesize) ?>" media="(min-width: 768px)" srcset="<?php echo($oElement->repeater_image->url) ?>" type="image/<?php echo($oElement->repeater_image->ext)?>"> <img data="<?php echo($oElement->repeater_image->filesize) ?>" class="img-fluid" loading="lazy" src="<?php echo($oElement->repeater_image->url) ?>" alt="<?php echo($oElement->repeater_image->description) ?>" type="image/<?php echo($oElement->repeater_image->ext)?>"> </picture>
  2. Hey guys, I have two performance related questions. Question 1. find vs get In my setup, I have a template called 'article,' which is a child of 'articles.' There are two ways to get all articles. This: $pages->get("/articles")->children; or this: $pages->find("template=article"); And if I wanted to further filter the articles by author , the queries would look like these: $pages->get("/articles")->children("author=john"); and $pages->find("template=article,author=john"); I think "get" would be faster in such situations. What are your thoughts? Are there any best coding practices for PW performance? Question 2: URL Routing The article urls in my old site are in this format: http://domainname.com/article-url. But, in PW, the urls look like this: http://domainname.com/articles/article-url. For URL redirection, based on what I was able to find on the forums, I made the homepage accept url segments. Then I route the requests based on the url segment (which essentially is the 'name' of the article page.) The question now is -- how big of performance hit will the site take due to this routing? Or am I needlessly thinking too much? thanks,
  3. Hey, So this have already been asked by some, and I have noticed your replies that Processwire is very fast, and if not you can cache the results. And I agree the same, still I have a question. We have around 6,00,000 ( 6 Lakh ) pages, and PW can deliver in ~1.9 to ~4 seconds. ie really awesome thing. One concern is at times it goes slow to ~5 seconds to 8 seconds ( I am talking about onload speed in browser , not the rendering speed ). So in my findings the problem is like we have a few cron jobs running via gearman to insert and update certain images and more than that . We are using PW Page api to do the insert / update stuffs. ( May be around a few 1000's of pages are fetched and process at a time ) . The question is whether there is a way to get the raw sql queries that we need to run on a single insert / update of a Page . Eg : $page = $this->pages->get("id={$data->article_id}"); if ($page->template == 'something') { $date = new DateTime(); $page->update_field = "Some data" $page->save(); } So the idea if I know the row sql query to run, we can get and insert via pdo with out the api and see how fast is it processing. Let me know if there is a way for the same. Also if you have any other suggestions / optimization tips I am Happy to hear and take. Thank you.
×
×
  • Create New...