This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p style="margin-bottom:100px;">Scroll this page.</p> | |
<div class="sticky"><h3>Super amazing header</h3></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const imageLazyLoad = (element) => { | |
const src = element.getAttribute('data-src'); | |
element.setAttribute('src', src); | |
element.removeAttribute('data-src'); | |
} | |
const observador = new IntersectionObserver(function(entries) { | |
entries.forEach(function(entry) { | |
// if (entry.isIntersecting === true || entryintersectionRatio > 0) { | |
if (entry.isIntersecting !== true) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ ^(/[^/]+/)?files/(.+) { | |
try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ; | |
access_log off; log_not_found off; expires max; | |
} | |
#avoid php readfile() | |
location ^~ /blogs.dir { | |
internal; | |
alias /var/app/current/wp-content/blogs.dir ; | |
access_log off; log_not_found off; expires max; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require("axios"); | |
const WORDPRESS_ENDPOINT = process.env.WORDPRESS_ENDPOINT; | |
const REPLACE_DOMAIN_FROM = process.env.REPLACE_DOMAIN_FROM; | |
const REPLACE_DOMAIN_TO = process.env.REPLACE_DOMAIN_TO; | |
const CACHE_SECONDS_200 = process.env.CACHE_SECONDS_200 || 60 * 5; // 5 minutes | |
const CACHE_SECONDS_301 = process.env.CACHE_SECONDS_301 || 60 * 30; // 30 minutes | |
const CACHE_SECONDS_404 = process.env.CACHE_SECONDS_404 || 60 * 15; // 15 minutes | |
exports.handler = async (event) => { |