Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/19/2021 in all areas

  1. <img loading="lazy" src="https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.320x0.png" srcset="https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.320x0.png 320w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.480x0.png 480w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.768x0.png 768w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.1240x0.png 1240w, https://comeinyourewelcome.nl/site/assets/files/1150/schermafbeelding_2021-09-28_om_00_35_23.1800x0.png 1800w" sizes="100vw" alt="Image from Untitled by Allen &amp; Overy" width="320px" height="485px" > This is your code from the static HTML. When I look into the browser inspector, all your images for 320w are loading highres images around 2.500 px width and more. ?? What looks not good to me is sizes="100vw" ?? I would expect something like sizes="auto". Also you uses PNG. Why not JPEG or WEBP? Loading 5MB per image also on small browser sizes. Uuups! The above was inspected with disabled javascript. So after correcting the base markup you also need to inspect what the JS does afterwards. Further optimization could be: Using a small data-image as default, like a 1px transparent gif or are more individual one in JPEG or PNG: src="data:image/jpeg;base64,... ... ..."
    2 points
  2. Hello guys, I am working on a website right now which has a problem with image load times https://comeinyourewelcome.nl/artworks/ I hope you can give me some advice on how to make it faster. – I usually have PW resize my images in several widths [320, 480, 768, 1240, 1800] and I made it so it doesn't upscale it. – I also have AutoSmush installed which reduces their sizes a little bit. – And native lazy loading of course. The problem arises as I am using MasonryJS to create my layout thus I don't want to implement infinite loading kind of thing. The browser says that I have slow server side response... Is there something fundamental that I am missing? Thanks a lot in advance!
    1 point
  3. The max number is relative to the size and availability of your database server. It also depends on how you set up your front-end output. For a short term solution, the first thing you need to do is to cache your front-end output as much as possible (without compromising the freshness of content of course). You can either use template caching or ProCache. Since you are on a shared host, you are at the mercy of the pool of sites/apps that are on the same vm. If you have the budget or want to have more control over how resources are being allocated, you might want to consider running your site on your own VPS. DigitalOcean, Linode, AWS to name a few. There are server provisioning management services out there that can help you with the set up. RunCloud, ServerPilot or Forge are some good examples.
    1 point
  4. Okay so just to help others out here is the PHP snippet that I managed to get working making a cURL request to the Spektrix V3 API <?php $date = new DateTime('NOW'); $date = $date->format('D, d M Y H:i:s \G\M\T'); $LoginName = "API USERNAME"; $SecretKey = "API SECRET KEY"; $StringToSign = "GET\nFULL URL YOU ARE QUERYING\n".$date; $StringToSignEncoded = utf8_encode( $StringToSign ); $SecretBase64Decoded = base64_decode($SecretKey); $sha1 = hash_hmac('sha1', $StringToSignEncoded, $SecretBase64Decoded,true); $Signature = base64_encode($sha1); $Authorization = "SpektrixAPI3 " . $LoginName . ":" . $Signature; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'FULL URL YOU ARE QUERYING', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Authorization:'.$Authorization, 'Date:'.$date ), )); $response = curl_exec($curl); var_dump($response); curl_close($curl); ?> I hope this helps someone else who was stuck on this one!
    1 point
  5. @Ivan Gretsky Hooks have already been added for this, and I think they were present in the dev version I posted in the ProFields board a few months back? I don't remember for sure, but I'm trying to make everything hookable so that people can modify the output as needed, and will keep looking for additional opportunities for that as I build in more related features. @teppo Yes there's a renderAddMatrixItemLink() hookable method for this, and it renders a link for one matrix item type, and gets called for each of them. So you could change the output to be anything you want. This is already present, but with the changes being made, chances are another hookable method will be added related to this. @Pete If I understand correctly, this is already there. See the "Matrix types to allow for adding new items" on the "Input" tab when editing your matrix field. This can be configured in template context which enables you to specify some types for one template and other types for another, etc. @mlfct Thanks, I was able to reproduce that here too and have pushed a fix on the dev branch.
    1 point
  6. Try this as Operator: ~%= or ~*= I use this on all my sites with the AjaxSearch module, but it should work here as well. Here you can find Ryan's blogpost: https://processwire.com/blog/posts/pw-3.0.160/
    1 point
  7. Session Viewer is a module for ProcessWire to list session files and display session data. This module is helpful to display the session data of a specific session or to kick out a logged in user by simply delete his session file. After installation the module is available in the Setup menu. The following conditions must be met for the module to work properly: Session files Session data must be stored in session files, which is the default way in ProcessWire. Sessions stored in the database are not supported by this module. The path to the directory where the session files are stored must be declared in the ProcessWire configuration which is by default: site/assets/sessions. Serialize handler In order to transform session data easier back to a PHP array, the session data is stored serialized. PHP offers a way to declare a custom serialize handler. This module supports only the default serialize handlers: php, php_binary and php_serialize. WDDX was dropped in PHP 7.4.0 and is therefore not supported by this module as well as any other custom serialize handler. Which serialize handler is actually used you can find out in the module configuration which is available under Modules=>Configure=>SessionViewer. Session data The session data can be displayed in two different ways. PHP's default output for arrays print_r() or by default for this module nice_r() offered on github: https://github.com/uuf6429/nice_r. There is a setting in the module configuration if someone prefers print_r(). Apart from the better handling and overview of the folded session data the output of nice_r() looks indeed nicer. Links ProcessWire module directory github.com
    1 point
  8. Looks nice @tcnet - would you consider a TracyDebugger dump() option? I think most PW users have it installed and it would save the need for the also installing the nice_r() library.
    1 point
  9. Great news you're working with Repeater/Repeater Matrix once again, @ryan! This new enhancement is superb and in line with the community requests in the Making Repeater Matrix better suitable for content building umbrella topic, specifically with @Zeka's 1st one in this post. Thank you! This is also a quite requested feature, so eagerly waiting on it! Could you please consider adding the ability to override the default mechanism of adding new items, so we could build a nicer UI for it if needed, as described here. Thanx in advance))
    1 point
  10. Sorry @eydun, I only saw your question now. I already brought the Floating Buttons into the game in 2018 as a proof of concept. You can find the code for them here: Or directly on GitHub: https://github.com/processwire/processwire-requests/issues/177
    1 point
  11. The cloning is in the scrolling event, because PW also clones the buttons at the page load (for the head area). If I clone the original savebuttons during pageload, they will also be duplicated in the head. However, it is ensured that this event is only executed once during scrolling as soon as the top threshold is reached. If a page is not long enough, no button needs to be cloned. The position storage is also intercepted with a debounce. The position is not saved until 250 milliseconds after the end of the scrolling event. It may look like this in the code, but any manipulation of the DOM is done only once.
    1 point
×
×
  • Create New...