Actions
Before and after purging URL
Run your code before purging a single URL (page): Similarly, run after purging a single URL (page):Few readersBefore and after purging all pages
Run your code before purging all pages: Similarly, run after purging all pages:Few readersBefore and after purging everything
Run your code before purging everything: Similarly, run after purging everything:Few readersFlyingPress plugin upgraded
Run any code when the FlyingPress plugin updates:Few readers
Filters
Change delay in preloading cache
FlyingPress default adds a delay of 0.5s while preloading the cache between each page. This slows down the process and ensures your server doesn't run out of resources. Here is how to set to delay as 1s - recommended for very low-resource servers: If you have a dedicated or high-end server, you can remove this delay by setting it to 0s as below:PopularModify optimized HTML output
You can use flyingpressoptimization:after filter to modify the final HTML which is optimized by FlyingPress. This modified HTML will be saved cache and served to visitors.Some readersCache page or not
The flyingpressiscacheable filter is used to specify custom conditions for determining whether FlyingPress should cache a page or not.Some readersChange JavaScript delay timeout
FlyingPress has a default timeout of 10s for delaying JavaScript. You can change it to any custom timeout. Here is how to set the timeout as 5s:Few readersAdd additional URLs to preload
FlyingPress fetches URLs to preload automatically; this includes posts, pages, custom posts, and taxonomies (category, tags etc.). If you've URLs that are not in this list but should be preloaded, you can use the filter flyingpresspreloadurls like below:Few readersGenerate separate cache for mobile
Since most of the websites now uses a responsive layout, it's not necessary to generate separate cache for mobile. However, if your theme or plugins or your custom code generates separate content for mobile/tablet devices by checking their user-agent, you can generate separate cache for mobile our filter.Few readersExclude files from JavaScript minify
FlyingPress UI doesn't provide an option to exclude JavaScript files from minify because it's compatible with 99.99% of the files. However, in any chance you would like to exclude JavaScript files from minifying, you can use the filter flyingpressexcludefromminify:js like below:Few readersExclude files from CSS minify
FlyingPress UI doesn't provide an option to exclude CSS files from minify because it's compatible with 99.99% of the files. However, in any chance you would like to exclude CSS files from minifying, you can use the filter flyingpressexcludefromminify:css like below:Few readersChange FlyingPress .htaccess rules
FlyingPress injects some rules to .htaccess to serve cached pages directly by the web server. You can change the rules by using the flyingpresshtaccessrules filter. The wrong htaccess rule may result in a server error and crash your entire site, be careful.Few readersChange YouTube placeholder resolution
When you've enabled "Use placeholder images for YouTube videos", the placeholder defaults to the resolution "hqdefault". You can change that using the filter flyingpressyoutubeplaceholderresolution :Few readersChange cached file name
FlyingPress generate a default cache file name like "index.html" or "index-logged-in.html", etc. The flyingpresscachefilename filter is used to modify the name of the cache file generated by FlyingPress.Few readersAdd or remove URLs to auto purge
FlyingPress automatically updates its cache of URLs to be purged whenever you publish, update, or delete content. However, if you want to add or remove specific URLs from this list, you can do so using the appropriate filters.Few readersManage access to FlyingPress
The default access to the FlyingPress dashboard and features is limited to users with the roles of " administrator" and " editor ". However, the flyingpressallowedroles filter can extend or restrict the allowed roles. Add a new role: Allow only selected roles:Few readersExclude specific user roles from cache
FlyingPress generates identical cached content for logged-in users with the same user role when the Cache logged in users option is enabled in the FlyingPress settings. To exclude specific user roles from the cache use the filter hook flyingpresscacheexcludedroles as described below.Few readers