Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of regularly updating the home page using the dream-weaving task scheduling function of DEDE

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the use of DEDE dream planning task function to update the home page regularly, the article is very detailed, has a certain reference value, interested friends must read it!

How to use the DEDE dream scheduling function to update the home page regularly?

Dedecms dream weaving system backstage has a task planning function, I believe many people do not know how to use, there is no detailed description, here is an actual case to explain how to use planning tasks to make the site automatically update the home page every 5 minutes.

Recommended study: dream weaving cms

Regularly update the home index.html file, update the advantage is that you can crawl index.html search engine spiders will not return the status code 304, the search engine will determine the update time of your HTML file to do comparison with the time before the index if there is an update is included, there is no update on the 304 status is not updated.

The following details how scheduled tasks are used:

First, enter the background-system-scheduled task management.

When you go inside, you can see a description of the execution of the planned task:

Instructions for scheduled task execution

In order to ensure that the task can be executed completely, it is recommended to use the client tool of Dede, otherwise it can only be triggered by JS, but there are many uncertainties in JS trigger that will cause the task not to be completed.

JS trigger method: call / plus/task.php?client=js with JS in all document pages (password for scheduled tasks must be disabled, system configuration parameters-> other options)

Custom client: directly visit the "http:// URL / plus/task.php?clientpwd= Management password" and return the URL of one of the executable tasks (if no task is available, return string: notask), and then the client can run this URL.

Next, we create a new scheduled task, which needs to have a PHP execution file to generate the home page of the website:

Plus.zip

Upload the extracted dede-post.php file to plus/task/ in the directory of the website.

In order to update the website every 5 minutes, we also need to modify the file plus/task/task.php.

Open task.php and change the $daylimit parameter to 300 seconds-$daylimit = 300; if you need to change it to another time, you can change it yourself and upload it. So far, all the conditions for the execution of basic tasks are in place, and there is still one way to trigger. Here we choose to use the JS file trigger method, which can be triggered as long as it is accessed by visitors. If your website is often unvisited, you can only access the trigger manually.

Let's just copy the code into the bottom template footer.htm.

In this way, every time someone visits your website, it will trigger the JS and let your executor run, that is, the website will be updated automatically.

The above is all the contents of the method of regularly updating the home page using the DEDE dream planning task function. Thank you for your reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report